less than serious - PreludeExts
esa.pulkkinen at kotiposti.net
Sat Jan 17 02:44:33 EST 2004
In message <400826CC.6050700 at cse.ogi.edu>, "Iavor S. Diatchki" writes:
>just out of curiosity, have you found any uses for the adjunction class?
>i spent quite a bit of time playing with adjunctions and they are very
>but i haven't been able to find particulalry appealing programming examples.
What I've used Adjunctions for is to represent the relationship between
coalgebraic data types (such as streams) and 'paths' in the data
structure (for streams, a natural number together with an abstract
element representing 'end-of-path' would be such path). The adjunction
type class, when interpreted like this, enforces the constraint that
every path leads to exactly one element of the data structure [due to
the type of the counit]. So to me it would seem that the Adjunction type
class is useful at least when the right adjoint is the functor of a
coalgebra and the left adjoint is a functor of an algebra that exactly
matches the structure of the coalgebra.
I've put an example to http://haskell.org/hawiki/PreludeExtsUseExamples.
More information about the Libraries