HaskellWiki

Haskell | Wiki community | Recent changes
Random page | Special pages

 

Not logged in
Log in | Help

TypeCompose

Categories: Composition | Applicative | Libraries | Packages


Contents

1 Abstract

Warning: The Haddock docs are out of date. I'm trying to get a working haddock 2.0 running (on my windows machine).

TypeCompose provides some classes & instances for forms of type composition, as well as some modules that haven't found another home.

Besides this wiki page, here are more ways to learn about TypeCompose:

Please leave comments at the Talk page.

2 Type composition

The Control.Compose module includes

3 Other features

3.1 Composable bijections

Given all the type constructors and compositions of them, I found myself writing some pretty awkward code to wrap & unwrap through multiple layers. Composable bijections help a lot.

The Data.Bijection module is inspired by There and Back Again: Arrows for Invertible Programming, though done here in a less general setting.

3.2 Pair- & function-like types

The Data.Pair and Data.Lambda patterns emerged while working on DeepArrow and Eros. Data.Pair generalizes zip and unzip from [] to other functors. It also provides variants of type f a -> f (a,b) and f a -> f (a,b). Data.Lambda is similar with classes for lambda-like constructions.

For example uses of Pair and Lambda, see TV and Eros.

3.3 References

Monads with references. Direct rip-off from Global Variables in Haskell.

3.4 Titling

For giving titles to things. I know it sounds kind of random. More useful than I first thought. Used in Phooey, TV, and Eros.

3.5 Partial values

A monoid of partial values. See the teaser and solution blog posts.

3.6 Context-dependent monoids

Bit of an oddball also. Data.CxMonoid defines a sort of meta-monoid, that can be supplied dynamically with choices of mempty and mappend. Used in Phooey (starting with version 1.3) so that layout could be a monoid but still vary in style.

Retrieved from "http://haskell.org/haskellwiki/TypeCompose"

This page has been accessed 2,640 times. This page was last modified 22:30, 18 December 2007. Recent content is available under a simple permissive license.