HaskellWiki

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

 

Not logged in
Log in | Help

DeepArrow

Categories: Libraries | Arrow | Combinators

Contents

1 Abstract

The DeepArrow library is a framework for composable "editors" of pure values.

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

Please leave comments at the Talk page.

2 Introduction

By 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 (a,(b,c)). In such a case, the transformation being targeted would have type b -> b', and the overall transformation would have type (a,(b,c)) -> (a,(b',c)).

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 DeepArrow library is about "deep function application" in two senses. First, compositions of first, second, and result apply functions deeply inside of values. Second, another set of combinators extract "deep functions" so they can be applied. Combining these two abilities allows a buried function to be applied to a buried argument, with the two contexts being carried along.

3 Examples

See example docs in the library documentation and follow the source code links.

4 Background

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. Lots of noodling led to ideas of composable interfaces and "tangible values" (term thanks to Sean Seefried) and gestural composition in Eros.

Eros was more complicated than I like, so I started splitting it into pieces:

-- Conal Elliott

Retrieved from "http://www.haskell.org/haskellwiki/DeepArrow"

This page has been accessed 3,987 times. This page was last modified 16:42, 12 January 2008. Recent content is available under a simple permissive license.