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 m e t. Moldable t e => Monoid m => (e -> m) -> t -> m

A default implementation of moldMap based on moldr

#moldMapDefaultL Source

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

#moldlDefault Source

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

A default implementation of moldl based on moldMap

#moldrDefault Source

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

A default implementation of moldr based on moldMap

#mold Source

mold :: forall e t. 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 e t. t -> Moldy t e e

Construct a Moldy

Modules
Data.Moldy