The Monoid Class

class hymn.types.monoid.Monoid

the monoid class

types with an associative binary operation that has an identity

property empty

the identity of append()

append(self, other)

an associative operation for monoid

classmethod concat(cls, seq)

fold a list using the monoid

hymn.types.monoid.append()

the associative operation of monoid

Hy Specific API

Functions

<>

alias of append()

Examples

append() adds up the values, while handling empty gracefully, <> is an alias of append()

=> (import hymn.types.maybe [Just Nothing])
=> (import hymn.types.monoid [<> append])
=> (append (Just "Cuddles ") Nothing (Just "the ") Nothing (Just "Hacker"))
Just('Cuddles the Hacker')
=> (<> (Just "Cuddles ") Nothing (Just "the ") Nothing (Just "Hacker"))
Just('Cuddles the Hacker')