Module

Data.Moldy

Package
purescript-moldy
Repository
LiamGoodacre/purescript-moldy

#Moldable Source

class Moldable t e | t -> e where

A Moldable type t is a monomorphic foldable structure with elements of type e.

Members

  • moldMap :: forall m. Monoid m => (e -> m) -> t -> m
  • moldl :: forall m. (m -> e -> m) -> m -> t -> m
  • moldr :: forall m. (e -> m -> m) -> m -> t -> m

Instances

#moldMapDefaultR Source

moldMapDefaultR :: forall t e m. Moldable t e => Monoid m => (e -> m) -> t -> m

A default implementation of moldMap based on moldr

#moldMapDefaultL Source

moldMapDefaultL :: forall t e m. Moldable t e => Monoid m => (e -> m) -> t -> m

#moldlDefault Source

moldlDefault :: forall t e m. Moldable t e => (m -> e -> m) -> m -> t -> m

A default implementation of moldl based on moldMap

#moldrDefault Source

moldrDefault :: forall t e m. Moldable t e => (e -> m -> m) -> m -> t -> m

A default implementation of moldr based on moldMap

#mold Source

mold :: forall t e. Moldable t e => Monoid e => t -> e

Combine all the elements in the moldable type using the action of the monoid

#Molded Source

newtype Molded t e

Every Foldable is Moldable

Constructors

Instances

#Moldy Source

data Moldy t e a

For any Moldable t e, Mold t e is Foldable

Constructors

Instances

#moldy Source

moldy :: forall t e. t -> Moldy t e e

Construct a Moldy

Modules
Data.Moldy