IKEA buttons
This commit is contained in:
+8
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user