
9 Jun
2020
9 Jun
'20
5:18 a.m.
lurkup is essentially lookup returning a CPS-version (Church encoding) of Maybe a. type CMaybe a = forall r. r -> (a -> r) -> r lurkup' :: k -> Map k a -> CMaybe a Is it worth to add a new name for this (above the Fairbairn threshhold)? I am quite happy with writing stuff like fromMaybe d $ Map.lookup k m On 2020-06-08 21:07, David Feuer wrote:
lurkup :: Ord k => r -> (a -> r) -> k -> Map k a -> r lurkup r f k = maybe r f . lookup k