
23 Nov
2011
23 Nov
'11
12:22 a.m.
On Wednesday 23 November 2011, 01:08:26, Lee Short wrote:
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?
A list comprehension [expression | condition] desugars to if condition then [expression] else [] IMO, that's one of the places where hlint doesn't suggest an improvement.