Open
Description
I was surprised to observe that ArrowChoice
\case
syntax[1] works[2] for Decidable
even in the absence of any other arrow syntax. We can quite happily write
\case
[] -> f -< ()
[x] -> g -< x+1
x1:x2:xs -> do
h -< (x1, x2, xs)
to get something of type f [Int]
when Decidable f
, f :: f ()
, g :: f Int
, h :: f (Int, Int, [Int])
. This addresses a problem I observed a while ago about the incomposability of Decidable
.
Perhaps I shouldn't surprised that this is possible. It's dual to how the the opposite half of arrow notation (Applicative
and <-
) supports ApplicativeDo
.
[1] Which doesn't actually seem to be supported by arrow notation, sadly
[2] Or rather "would work"
Metadata
Assignees
Labels
No labels
Activity