IKEA buttons

This commit is contained in:
2026-08-20 23:40:14 +03:00
parent 2a1bca73d7
commit 4d689be6ea
4 changed files with 76 additions and 5 deletions
+8 -1
View File
@@ -17,6 +17,7 @@ module AFRP
, thenA
, (>>|)
, toEvent
, lMerge
) where
import Control.Category (Category(..), (>>>))
@@ -142,7 +143,13 @@ thenA f g = f >>> arr Left ||| g
(>>|) :: (ArrowChoice cat, Arrow cat) => cat a (Either b1 c) -> cat c (Either b1 b2) -> cat a (Either b1 b2)
(>>|) = thenA
infixl 1 >>|
infixl 2 >>|
toEvent :: Mealy eff (Either () a) (Event a)
toEvent = arr (either (const Tick) Event)
lMerge :: Event a -> Event a -> Event a
lMerge Tick Tick = Tick
lMerge (Event a) _ = Event a
lMerge Tick (Event a) = Event a