You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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"
The text was updated successfully, but these errors were encountered:
tomjaguarpaw
changed the title
ArrowChoice case syntax works for Decidable
ArrowChoice case syntax works for Decidable
Jan 23, 2020
I was surprised to observe that
ArrowChoice
\case
syntax[1] works[2] forDecidable
even in the absence of any other arrow syntax. We can quite happily writeto get something of type
f [Int]
whenDecidable f
,f :: f ()
,g :: f Int
,h :: f (Int, Int, [Int])
. This addresses a problem I observed a while ago about the incomposability ofDecidable
.Perhaps I shouldn't surprised that this is possible. It's dual to how the the opposite half of arrow notation (
Applicative
and<-
) supportsApplicativeDo
.[1] Which doesn't actually seem to be supported by arrow notation, sadly
[2] Or rather "would work"
The text was updated successfully, but these errors were encountered: