@@ -409,8 +409,21 @@ instance (Reflex t, Semigroup a) => Semigroup (Behavior t a) where
409409#endif
410410
411411--TODO: See if there's a better class in the standard libraries already
412+
412413-- | A class for values that combines filtering and mapping using 'Maybe'.
413−class FunctorMaybe f where
414+-- Morally, @'FunctorMaybe' ~ KleisliFunctor 'Maybe'@. Also similar is the
415+-- @Witherable@ typeclass, but it requires @Foldable f@ and @Traverable f@,
416+-- and e.g. 'Event' is instance of neither.
417+--
418+-- A definition of 'fmapMaybe' must satisfy the following laws:
419+--
420+-- [/identity/]
421+-- @'fmapMaybe' 'Just' ≡ 'id'@
422+--
423+-- [/composition/]
424+-- @'fmapMaybe' (f <=< g) ≡ 'fmapMaybe' f . 'fmapMaybe' g@
425+
426+class Functor f => FunctorMaybe f where
414427 -- | Combined mapping and filtering function.
415428 fmapMaybe :: (a -> Maybe b) -> f a -> f b
416429