reflex-0.5: Higher-order Functional Reactive Programming

Safe HaskellSafe
LanguageHaskell98

Reflex.FunctorMaybe

Description

This module defines the FunctorMaybe class, which extends Functors with the ability to delete values.

Synopsis

Documentation

class FunctorMaybe f where Source #

A class for values that combines filtering and mapping using Maybe. Morally, FunctorMaybe ~ KleisliFunctor Maybe. Also similar is the Witherable typeclass, but it requires Foldable f and Traverable f, and e.g. Event is instance of neither.

A definition of fmapMaybe must satisfy the following laws:

identity
fmapMaybe Justid
composition
fmapMaybe (f <=< g) ≡ fmapMaybe f . fmapMaybe g

Methods

fmapMaybe :: (a -> Maybe b) -> f a -> f b Source #

Combined mapping and filtering function.

Instances
FunctorMaybe [] Source #
fmapMaybe = mapMaybe
Instance details

Defined in Reflex.FunctorMaybe

Methods

fmapMaybe :: (a -> Maybe b) -> [a] -> [b] Source #

FunctorMaybe Maybe Source #

@fmapMaybe = (=<<)

Instance details

Defined in Reflex.FunctorMaybe

Methods

fmapMaybe :: (a -> Maybe b) -> Maybe a -> Maybe b Source #

FunctorMaybe IntMap Source # 
Instance details

Defined in Reflex.FunctorMaybe

Methods

fmapMaybe :: (a -> Maybe b) -> IntMap a -> IntMap b Source #

FunctorMaybe (Map k) Source # 
Instance details

Defined in Reflex.FunctorMaybe

Methods

fmapMaybe :: (a -> Maybe b) -> Map k a -> Map k b Source #

FunctorMaybe (MonoidalMap k) Source # 
Instance details

Defined in Data.AppendMap

Methods

fmapMaybe :: (a -> Maybe b) -> MonoidalMap k a -> MonoidalMap k b Source #

HasSpiderTimeline x => FunctorMaybe (Event x) Source # 
Instance details

Defined in Reflex.Spider.Internal

Methods

fmapMaybe :: (a -> Maybe b) -> Event x a -> Event x b Source #

Reflex t => FunctorMaybe (Event t) Source # 
Instance details

Defined in Reflex.Class

Methods

fmapMaybe :: (a -> Maybe b) -> Event t a -> Event t b Source #