« first day (8 days earlier)      last day (1955 days later) » 

9:00 PM
I frequently need to plug one value into two different functions and then combine the output of these functions somehow, and I wonder whether there is a builtin for that:
Something like (a->b) -> (a->c) -> (b->c->d) -> (a -> d)
 
 
1 hour later…
10:09 PM
@flawr That's liftA2 :: (a -> b -> c) -> f a -> f b -> f c where f is the function functor. This without the import goes f<$>g<*>h which is equivalent to \x -> f (g x) (h x)
 
10:26 PM
@H.PWiz Thanks, I totally forgot that functions are also functor instances!
looking forward to the day when I know the typeclassopedia by heart
 

« first day (8 days earlier)      last day (1955 days later) »