对于这个挑战,您需要从stdin中读取一行,并检查它是整型、浮点型还是字符串类型。If input is- Integer print‘此输入的类型为Integer。’对stdout浮点型打印'This input is type Float‘对于stdout字符串,打印“This input is type String”对于stdout,则打印“This is print例如,如果我的输入: 45.6输出:浮点数
所以,我的问题是,我如何能够接受输入,就像
现在我想检查一下从字符串到浮点数(read函数)的转换是否成功。如果转换成功,我想返回点(只返回Point2D),当尝试失败时返回Nothing。问题是,案例需要IO,但也得到了一个简单的IO。:: [String] pointExtraction (x:y:tail) = do
let result = try