backend-0.1.0.0
Safe HaskellSafe-Inferred
LanguageHaskell2010

Control.Functor.Utils

Synopsis

Documentation

class Functor f => Pure (f :: Type -> Type) where Source #

Like Applicative, but without *. For any instance of both Applicative and Pure, it should hold pure' = pure.

Methods

pure' :: a -> f a Source #

Instances

Instances details
Pure Node Source # 
Instance details

Defined in Language.Ltml.AST.Node

Methods

pure' :: a -> Node a Source #

Pure Identity Source # 
Instance details

Defined in Control.Functor.Utils

Methods

pure' :: a -> Identity a Source #

Pure (Either e) Source # 
Instance details

Defined in Control.Functor.Utils

Methods

pure' :: a -> Either e a Source #

class Functor t => TraversableF (t :: Type -> Type) where Source #

A variant of Traversable with weaker constraints.

In particular, traverseF and sequenceF weaken the Applicative constraint to a Functor constraint.

Among the type class constraints, the Functor constraint is obvious, for fmap can be implemented using traverseF. The Foldable constraint, however, which is present for Traversable, is debatable, and was removed for convenience.

It is debatable whether the class and function names are fitting.

Minimal complete definition

traverseF | sequenceF

Methods

traverseF :: Functor f => (a -> f b) -> t a -> f (t b) Source #

Like traverse, but with weaker constraints.

sequenceF :: Functor f => t (f a) -> f (t a) Source #

Like sequenceA, but with weaker constraints.

Instances

Instances details
TraversableF SectionFormatted Source # 
Instance details

Defined in Language.Lsd.AST.Type.Section

TraversableF (Flagged flag) Source # 
Instance details

Defined in Language.Ltml.Common

Methods

traverseF :: Functor f => (a -> f b) -> Flagged flag a -> f (Flagged flag b) Source #

sequenceF :: Functor f => Flagged flag (f a) -> f (Flagged flag a) Source #

traverseEither :: Pure f => (a -> f b) -> Either e a -> f (Either e b) Source #

Like traverse and traverseF, for 'Either e', and with constraint in between. This could also defined via a corresponding type class, but we'd only need this one instance.

sequenceEither :: Pure f => Either e (f a) -> f (Either e a) Source #

Variant of sequenceA, like traverseEither is a variant of traverse.