The DeepArrow library is a framework for composable "editors" of pure values.
- darcs get http://darcs.haskell.org/packages/DeepArrow
- Read the Haddock docs (with source code & Comment/Talk links)
1 IntroductionBy an "editor", I mean a function that targets a transformation at some part of a value, such as the first half of the second half of a value of type
If you've fooled around with arrows, you might guess that the arrow methods first and second having something to do with this game, and you'd be right. The main idea of DeepArrow is to play with compositions of first and second and of an analogous third combinator called result. I was stunned to realize that arbitrarily complex value editors can be made by stringing together compositions of these three combinators and delighted to find that the composition chains directly spell out the paths to the value subpart to be edited.
The inspiration for value-editing paths came while I was looking for a way for non-programmers to be able to create functional images. I've had a growing intuition over the last fifteen years that media authoring tools can be usefully looked at as environments for functional programming. I'd been wondering how to map a user's gestures into operations on a functional program.