14 Jul
2015
14 Jul
'15
1:03 a.m.
For this specific use case, you can also consider list comprehensions: [ x | x@(DataDefinition _) <- tlds ] I personally greatly prefer this over something like ‘filter’ + an ugly lambda, especially if you can use the list comprehension for the rest of your processing as well. On Mon, 13 Jul 2015 16:40:33 +0300, Nikolay Amiantov <ab@fmap.me> wrote:
A nice idea! It can be helpful in some cases, although usually I have more complex patterns, for example "get all DataDefinitions from a list of TopLevelDefinitions parsed from a .hs file" or "filter all KeyPresses directed to a particular window from an Event stream".