Control-Monad-MultiPass-0.1.0.0: A Library for Writing Multi-Pass Algorithms.

Safe HaskellSafe

Control.Monad.MultiPass.Example.Localmin

Description

A variation on the repmin example. This example shows how the Knot3 can be used in a recursive algorithm.

Synopsis

Documentation

data Tree a Source

Constructors

Leaf !a 
Node !(Tree a) !(Tree a) 

Instances

Eq a => Eq (Tree a) 
Show a => Show (Tree a) 

localmin :: Ord a => Tree a -> Tree [a]Source

Version using lazy evaluation.

localminMP :: Ord a => Tree a -> ST2 r w (Tree [a])Source

Version using the Control.Monad.MultiPass library.