
19 Feb
2015
19 Feb
'15
5:37 a.m.
On Thu, Feb 19, 2015 at 10:56 AM, Oliver Charles
A slightly more complicated example is
youngPeople = proc () -> do row@(_, age, _) <- personQuery -< () restrict -< age .<= 18 returnA -< row
could become
(| fst (second (lmap age restrict) . (| dup personQuery |)) |) where dup a = (a,a)
OT: you might be able to make this clearer with `where_` [1] which we defined in our opaleye utility package [2]. It feels much more natural to me than restrict, and works much better with composition outside of arrow notation. Erik [1] https://github.com/silkapp/silk-opaleye/blob/c3a324e277d730eafa9c455e1a33e67... [2] https://github.com/silkapp/silk-opaleye