on master help sign in
Add the beginnings of an `Automaton` library.
cba2cf6evancz
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+--}