>>785
foldlだと駄目だと思うけど、foldrだといけるんじゃ?

dofirst p f = foldr k Nothing
where k a b = if p a then Just (f a) else b
-- dofirst (==20) (*2) [1..] => Just 40

dofirst' p f = foldl k Nothing
where k b a = if p a then Just (f a) else b
-- dofirst' (==20) (*2) [1..] => _|_