Store a custom snapshot of lights
This commit is contained in:
1 parent
fcaccfdeb0
commit
fefeae6301
15 files changed
+173
-24
No files matched your search
@@ -42,6 +42,7 @@ module AFRP
|
||||
, load
|
||||
, stepAuto
|
||||
, stepAutoSerializing
|
||||
, snapshot
|
||||
) where
|
||||
|
||||
import Control.Category (Category(..), (>>>))
|
||||
@@ -325,6 +326,11 @@ hold def = mapAccum step def id
|
||||
Tick -> prev
|
||||
Event new -> new
|
||||
|
||||
snapshot :: (Serialize a, Eq a) => a -> Mealy m (Event (), a) a
|
||||
snapshot def = mapAccum step def id
|
||||
where
|
||||
step prev (Tick, _) = prev
|
||||
step _prev (Event _, a) = a
|
||||
|
||||
events :: Mealy eff (Event a) (Either () a)
|
||||
events = arr $ \case
|
||||
|
||||
Reference in new issue
Block a user