if "read" can not infer type, we have to specify it

2 views
Skip to first unread message

wenshe...@gmail.com

unread,
Apr 20, 2007, 12:19:25 AM4/20/07
to haskell.cn
Prelude> read "300"

<interactive>:1:0:
Ambiguous type variable `a' in the constraint:
`Read a' arising from use of `read' at <interactive>:1:0-9
Probable fix: add a type signature that fixes these type
variable(s)
Prelude> read "300"::Int
300
Prelude>

Reply all
Reply to author
Forward
0 new messages