[Haskell-beginners] Parsing an integer

Tim Baumgartner baumgartner.tim at googlemail.com
Sun Nov 21 07:27:06 EST 2010


Hi folks,

since I always get great answers here, I have another question. I'm
currently parsing a (positive) integer using

data Token = Number Int  -- ...
number :: Parser Token
number = many1 digit ↠ (read >>> Number >>> return)
-- = many1 digit ↠ return∘Number∘read

But I wonder what an advanced haskeller would code instead.
Particularly, I'd like to get rid of the 'return'.

Thanks in advance
Tim


More information about the Beginners mailing list