Refactor to a more arrows style syntax

This commit is contained in:
MasseR committed 2026-10-24 00:18:04 +03:00
1 parent 078f24e4b9
commit 5f8b3cbe00
2 files changed
+23 -28

No files matched your search

+2 -2
View File
@@ -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)