Module

Data.Functor.Singleton

#SingletonFunctor

class (Functor f) <= SingletonFunctor f  where

Instances must follow these laws:

inverse :: forall f a. Applicative f => Prop
inverse =
     (getSingleton :: f a -> a) <<< (pure :: a -> f a)
  == (id :: a -> a)

viaconst :: forall f a b. Functor f => Prop
viaconst = forall (x :: b). forall (xs :: f a).
     (getSingleton :: f b -> b) <<< (map (const x) :: f a -> f b)
  == (const x :: f a -> b)

Members

Instances

#liftWith_

liftWith_ :: forall t m stT b. MonadTransControl m t stT => SingletonFunctor stT => Monad m => ((forall a. t m a -> m a) -> m b) -> t m b

#liftBaseWith_

liftBaseWith_ :: forall base m stM b. MonadBaseControl base m stM => SingletonFunctor stM => Functor base => ((forall a. m a -> base a) -> base b) -> m b

Modules