[Haskell-beginners] doubt....plz help me out

kolli kolli nammukolli04 at gmail.com
Tue Oct 18 04:17:04 CEST 2011


I am new to haskell plz dnt mind


scan :: [Char] -> Token
scan ('i':'f':tl)  = IfKeyword
scan ('t':'h':'e':'n':tl)  = ThenKeyword
scanp :: [Char] -> [Token]
scanp t  = sequence (map scan t)

when I call scan on my file which has "if then"
then its just printing if as IfKeyword ..its nt talking the then word

I tried using sequence but its nt working..Can you please help me out..

I have to get the output as a list of tokens

[IfKeyword, ThenKeyword]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20111017/77b994e2/attachment.htm>


More information about the Beginners mailing list