[Haskell-cafe] A function that makes list of Bool lists from list of Int lists

Daniel Fischer daniel.is.fischer at web.de
Sat Apr 3 10:10:16 EDT 2010


Am Samstag 03 April 2010 15:54:26 schrieb Maur Toter:
> Hey,
>
> I am new with Haskell so I think this will be a pretty dumb question.
> I would like to make a function that makes this:
>
> listbool :: [[Int]] -> [[Bool]]
>
> in this way:
> listbool [[1,2],[3,4]] == [[True, True],[False, False]]
> listbool [[1],[5,5],[5,4],[2]] == [[True],[False, False],[True, True],
> [False]]
>
> So always True from the elements of the first list, False from the
> elements of the second one, etc...
>
>
> Can you help me to do that?
> Thanks for your help!

Looks like homework, so only a few hints:

zipWith, cycle, const

>
> Maur Toter



More information about the Haskell-Cafe mailing list