
In message <400826CC.6050700@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 useful, 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. -- Esa Pulkkinen