やり方read.returnを使って型を指定すれば良い haskellPrelu
やり方
read . returnを使って型を指定すれば良い
haskell
Prelude> let n = "123456789" :: String
Prelude> n
"123456789"
Prelude> map return n :: [String]
["1","2","3","4","5","6","7","8","9"]
Prelude> map (read . return) n :: [Int]
[1,2,3,4,5,6,7,8,9]
Prelude> map (read . return) n :: [Float]
[1.0,2.0,3.0,4.