[<<][meta_siso][>>][..]
Sun Aug 2 12:59:39 EDT 2015

CompRed try

tom@zoo:~/meta$ darcs wh
hunk ./siso/Code.hs 200
-class CompRed t o where
-      compRed :: t -> Comp o
-
-instance (MakeVar i, Flatten i) => [_$_]
-         CompRed (i -> Comp o) -> o where
-  compRed f = makeVar >>= fun >>= f
hunk ./siso/Code.hs 201
-instance CompRed (Sys Comp i o) o where  [_$_]
-  compRef (Sys stateInit update) = do
-    f <- compRed $ flip update
+appFun :: (MakeVar i, Flatten i, Flatten o) => (i -> Comp o) -> Comp o
+appFun f = makeVar >>= fun >>= f
+
+appSys (Sys stateInit update) = do
hunk ./siso/Code.hs 206
-    (stateNext, out) <- f stateVar
+    (stateNext, out) <- appFun $ update stateVar
hunk ./siso/Code.hs 211
+--class CompRed t o where compRed :: t -> Comp o
+--instance (MakeVar i, Flatten i) => CompRed (i -> Comp o)  o where compRed = appFun
+--instance (MakeVar i, Flatten i) => CompRed (Sys Comp i o) o where compRed = appSys
+  [_$_]
+
hunk ./siso/Code.hs 232
-compFun :: (MakeVar i, Flatten i, Flatten o) =>
-           State ->
-           (i -> Comp o) -> (State, Term)
-compFun s f = compSC s $ appFun f
-
-compSys :: (MakeVar i, Flatten i, Flatten o) =>
-           State ->
-           Sys Comp i o -> (State, Term)
-compSys s sys = compSC s (appSys sys)
+comp :: CompRed t o => State -> t -> (State, Term)
+comp s f = compSC s $ compRed f




[Reply][About]
[<<][meta_siso][>>][..]