[Haskell-cafe] A really bad way to say "all isSpace"
Neil Mitchell
ndmitchell at gmail.com
Tue Jul 10 10:18:35 EDT 2007
Hi,
Reading through the code to read:
read s = case [x | (x,t) <- reads s, ("","") <- lex t] of
[x] -> x
[] -> error "Prelude.read: no parse"
_ -> error "Prelude.read: ambiguous parse"
Reading through the code to lex, it appear that it will return
[("","")] if and only if all isSpace t.
If this is really the case, does it make sense to state all isSpace t?
It has a much clearer meaning to me.
Thanks
Neil
More information about the Haskell-Cafe
mailing list