[Haskell-cafe] Prelude> read "1234" :: String -> "*** Exception: Prelude.read: no parse

Scott Lawrence bytbox at gmail.com
Sun Aug 7 02:00:24 CEST 2011


read expects strings to be quoted:

Prelude> read "\"1234\"" :: String
"1234"


On Sat, Aug 6, 2011 at 19:57, michael rice <nowgate at yahoo.com> wrote:

> Prelude> read "1234" :: Int
> 1234
> Prelude> read "1234" :: String
> "*** Exception: Prelude.read: no parse
>
> Why?
>
> Michael
>
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
>


-- 
Scott Lawrence
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20110806/8da80ae8/attachment.htm>


More information about the Haskell-Cafe mailing list