Skip to content

ArrowChoice case syntax works for Decidable #6

Open
@tomjaguarpaw

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"

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions