On Fri, May 29, 2009 at 3:38 PM, Bartosz Wójcik <[email protected]> wrote:

> Thank you, this is an easy and nice solution. I've made it a bit prettier
> optically:
>
> myFloat = try (symbol "-" >> float >>= return . negate)
>     <|>  try float
>     <|>  (integer >>= return . fromIntegral)
>

Any time you see ">>= return .", something is being missed. Use liftM or <$>
instead, i.e. "fromIntegral <$> integer" instead of "integer >>= return .
fromIntegral".
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to