on master help sign in
Add the beginnings of an `Automaton` library.
commitcba2cf6fbcf7ef9d0247008b46ad339075b1f09c authorevancz <info@elm-lang.org> dateThu 4 Oct 2012, 21:13 (14 years ago) parent16895c4
1 file changed+24
core-elm/Automaton.elm+24
core-elm/Automaton.elmnew file+24
@@ -0,0 +1,24 @@
1+
2+module Automaton where
3+
4+data Automaton inp out = Automaton (inp -> (out, Automaton inp out))
5+
6+{--- API possibilies
7+
8+All names and types are up for debate!
9+
10+
11+How to run an automaton (some require typeclasses):
12+
13+run :: Automaton a b -> Signal a -> Signal b
14+run :: OrderedContainer c => Automaton a b -> c a -> c b
15+run :: Functor f => Automaton a b -> f a -> f b
16+
17+
18+compose :: Automaton a b -> Automaton b c -> Automaton a c
19+combine :: [Automaton a b] -> Automaton a [b]
20+
21+init :: b -> (a -> b -> b) -> Automaton a b
22+init' :: s -> (a -> s -> (b,s)) -> Automaton a b
23+
24+--}