Refactor to a more arrows style syntax
This commit is contained in:
1 parent
078f24e4b9
commit
5f8b3cbe00
2 files changed
+23
-28
No files matched your search
+2
-2
@@ -507,7 +507,7 @@ 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 2 >>||
|
||||
infixl 2 >>|
|
||||
|
||||
(>>||) :: (ArrowChoice cat, Arrow cat) => cat a (Event b) -> cat b c -> cat a (Event c)
|
||||
f >>|| g = proc x -> do
|
||||
@@ -516,7 +516,7 @@ f >>|| g = proc x -> do
|
||||
Event e' -> g >>> arr Event -< e'
|
||||
Tick -> arr (const Tick) -< ()
|
||||
|
||||
infixr 3 >>|
|
||||
infixr 1 >>||
|
||||
|
||||
toEvent :: Mealy eff (Either () a) (Event a)
|
||||
toEvent = arr (either (const Tick) Event)
|
||||
|
||||
Reference in new issue
Block a user