on develop help sign in
Merge pull request #147 from reflex-frp/maybe-functormaybe

Add FunctorMaybe instance to Maybe

commitc56abf28018161cac6c8042fecec21dda669c5f4 authorRyan Trinkle <ryan.trinkle@gmail.com> dateWed 3 Jan 2018, 22:40 (9 years ago) parent01cef411724c42
1 file changed+4
src/Reflex/FunctorMaybe.hs+4
src/Reflex/FunctorMaybe.hs+4
@@ -24,6 +24,10 @@ class FunctorMaybe f where
2424 -- | Combined mapping and filtering function.
2525 fmapMaybe :: (a -> Maybe b) -> f a -> f b
2626
27+-- | @fmapMaybe = (=<<)
28+instance FunctorMaybe Maybe where
29+ fmapMaybe = (=<<)
30+
2731-- | @fmapMaybe f = catMaybes . fmap f@
2832instance FunctorMaybe [] where
2933 fmapMaybe f = catMaybes . fmap f