Constructing a list

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Constructing a list

maina
I am an absolute newbie with haskell and struggling with the basics , Can someone please tell
me how to build a list this way for each char of the string


buildlist:: String->[String]
buildlist (c:cs)= case c of
                      'f'      -> [ "first"]
                      's'      -> [ "second" ]

                     buildlist cs