Go to file
Gabriel Gonzalez 98ef584a67 Permit field access for unions with one element
Note that I haven't even implemented union literals, so this can't even be used,
yet!

This lets you access the field of a union if it has exactly one alternative.

The basic idea is that a subsequent change will provide an operator for merging
pattern matches with the following pseudo-type:

    a : Type, b : Type, r : Type |- (\/) : (a → r) → (b → r) → (a \/ b → r)

For example:

        (\/)
    :   (< foo : Bool > → Integer)
    →   (< bar : Text > → Integer)
    →   (< foo : Bool | bar : Text > → Integer)

You can then combine `(\/)` in conjunction with field access to implement
pattern matching:

    let example : < foo : Bool | bar : Natural > → Bool =
            (λ(x : < foo : Bool    >) → x.foo               )
        \/  (λ(x : < bar : Natural >) → Natural/even (x.bar))
    in  example
2016-10-11 17:26:11 -07:00
exec Switch to happy for parsing and simplify the alex lexer 2016-09-11 20:38:37 -07:00
src Permit field access for unions with one element 2016-10-11 17:26:11 -07:00
dhall.cabal Remove unused dependencies 2016-09-11 21:59:27 -07:00
LICENSE Initial commit 2016-09-07 09:17:12 -07:00
Setup.hs Initial commit 2016-09-07 09:17:12 -07:00
stack.yaml Switch to a newer stack resolver 2016-09-09 09:15:27 -07:00