[Haskell-beginners] List comprehension question

Lee Short blackcat at pro-ns.net
Wed Nov 23 01:08:26 CET 2011


 So hlint suggests that I convert the line

 checked = if ival==input   then [("checked","checked")]  else []

 to

 checked = [("checked","checked") | ival==input]

 I'm not really sure why this works.  Is there some implicit list being 
 filtered by ival==input?  What's going on?

 thanks
 Lee




More information about the Beginners mailing list