Portability | non-portable |
---|---|
Stability | experimental |
Maintainer | sjoerd@w3future.com |
Safe Haskell | None |
Data.Algebra.Internal
Description
Documentation
class Functor f => AlgebraSignature f whereSource
Methods
evaluate :: Class f b => f b -> bSource
Translate the operations of the signature to method calls of the class.
Instances
Methods
algebra :: AlgebraSignature f => f a -> aSource
An algebra f a -> a
corresponds to an instance of a
of the class Class f
.
In some cases, for example for tuple types, you can give an algebra generically for every signature:
instance (Class f m, Class f n) => Algebra f (m, n) where algebra fmn = (evaluate (fmap fst fmn), evaluate (fmap snd fmn))