# On how to use the *pure* functions: read :: Read a => String -> a reads :: Read a => ReadS a What is this type ReadS a? Let's ask GHCi: λ> :info ReadS type ReadS a = String -> [(a, String)] To use read, we need to specify the type a: λ> read "123" :: Int 123 λ> read "123" :: Integer 123 λ> read "123" :: String "*** Exception: Prelude.read: no parse λ> read "\"123\"" :: String "123" λ> read "[12,3]" :: [Int] [12,3] To use reads, we also need to specify the type a: λ [Prelude]> reads "123hello" :: [(Integer, String)] [(123,"hello")] λ [Prelude]> reads "123hello" :: [(String, String)] [] What is this? When we evaluate reads x :: [(α, String)] it returns [] if it cannot parse x as a value of type α. Otherwise, it returns a singleton list [(v, rst)] where v :: α is the value parsed from the given string x, and rst is the remaining string.