jonathanfishbein1 / elm-semigroup / SemiGroup

A module to define generic functions for semigroup.

Types


type SemiGroup a
    = SemiGroup (a -> a -> a)

Main type.


type Sum a
    = Sum a

Semigroup under addition


type Product a
    = Product a

MoSemigroupnoid under multiplication.

append : SemiGroup a -> a -> a -> a

Take the way to append a semigroups.

SemiGroup types for popular types

string : SemiGroup String

Semigroup type for String.

sum : SemiGroup (Sum number)

Semigroup type for Sum.

product : SemiGroup (Product number)

Semigroup type for Product.

list : SemiGroup (List a)

Semigroup type for List.

array : SemiGroup (Array a)

SemiGroup type for Array.

dict : SemiGroup (Dict comparable a)

SemiGroup type for Dict.

set : SemiGroup (Set comparable)

SemiGroup type for Set.

cmd : SemiGroup (Platform.Cmd.Cmd comparable)

SemiGroup type for Cmd.

sub : SemiGroup (Platform.Sub.Sub comparable)

Monoid type for Sub.