@@ -409,8 +409,21 @@ instance (Reflex t, Semigroup a) => Semigroup (Behavior t a) where
411--TODO: See if there's a better class in the standard libraries already
411--TODO: See if there's a better class in the standard libraries already
412-- | A class for values that combines filtering and mapping using 'Maybe'.
413-- | A class for values that combines filtering and mapping using 'Maybe'.
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.
418+-- A definition of 'fmapMaybe' must satisfy the following laws:
421+-- @'fmapMaybe' 'Just' ≡ 'id'@
424+-- @'fmapMaybe' (f <=< g) ≡ 'fmapMaybe' f . 'fmapMaybe' g@
413−class FunctorMaybe f where
426+class Functor f => FunctorMaybe f where
414 -- | Combined mapping and filtering function.
427 -- | Combined mapping and filtering function.
415 fmapMaybe :: (a -> Maybe b) -> f a -> f b
428 fmapMaybe :: (a -> Maybe b) -> f a -> f b