summaryrefslogtreecommitdiff
path: root/dhall/src/errors/InvalidAlterantiveType.txt
blob: f5dadef45ddd274d44714b0a4f48de466b4ef276 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
Explanation: Every union literal begins by selecting one alternative and
specifying the value for that alternative, like this:


        Select the ❰Left❱ alternative, whose value is ❰True❱
        ⇩
    ┌──────────────────────────────────┐
    │ < Left = True, Right : Natural > │  A union literal with two alternatives
    └──────────────────────────────────┘


However, this value must be a term and not a type.  For example, the following
values are $_NOT valid:


    ┌──────────────────────────────────┐
    │ < Left = Text, Right : Natural > │  Invalid union literal
    └──────────────────────────────────┘
               ⇧
               This is a type and not a term


    ┌───────────────────────────────┐
    │ < Left = Type, Right : Type > │  Invalid union type
    └───────────────────────────────┘
               ⇧
               This is a kind and not a term


You provided a union literal with an alternative named:

↳ $txt0

... whose value is:

↳ $txt1

... which is not a term

Some common reasons why you might get this error:

● You accidentally typed ❰=❱ instead of ❰:❱ for a union literal with one
  alternative:

    ┌────────────────────┐
    │ < Example = Text > │
    └────────────────────┘
                ⇧
                This could be ❰:❱ instead