@@ -55,6 +55,7 @@ init' s f = Step (\x -> let (s',out) = f x s
55count : Automaton a Int
55count : Automaton a Int
56count = init 0 (\_ c -> c + 1)
56count = init 0 (\_ c -> c + 1)
58type Queue t = ([t],[t])
59type Queue t = ([t],[t])
59empty = ([],[])
60empty = ([],[])
60enqueue x (en,de) = (x:en, de)
61enqueue x (en,de) = (x:en, de)
@@ -75,7 +76,7 @@ average k =
75 Just (m,ns') -> let sum' = sum + n - m
76 Just (m,ns') -> let sum' = sum + n - m
76 in ((enqueue n ns', len, sum'), sum' / len)
77 in ((enqueue n ns', len, sum'), sum' / len)
77 in init' (empty,0,0) step
78 in init' (empty,0,0) step
79{-- TODO(evancz): move this code to the Form library so people can find it.
80{-- TODO(evancz): move this code to the Form library so people can find it.
81data DragState = Listen | Ignore | DragFrom (Int,Int)
82data DragState = Listen | Ignore | DragFrom (Int,Int)