summaryrefslogtreecommitdiff
path: root/dhall/src/errors/InvalidOptionalLiteral.txt
diff options
context:
space:
mode:
authorNadrieril2019-03-01 17:28:19 +0100
committerNadrieril2019-03-01 17:28:19 +0100
commite5d9aee00b0c775df1d8e2d8819aeb80dffa73c2 (patch)
treee763a24a0d635048232e72e167ca37eafec69369 /dhall/src/errors/InvalidOptionalLiteral.txt
parent8a2b7536902831079eddd7b00291b718f5dd7186 (diff)
Split abnf_to_pest and dhall into their own crates
Diffstat (limited to 'dhall/src/errors/InvalidOptionalLiteral.txt')
-rw-r--r--dhall/src/errors/InvalidOptionalLiteral.txt53
1 files changed, 53 insertions, 0 deletions
diff --git a/dhall/src/errors/InvalidOptionalLiteral.txt b/dhall/src/errors/InvalidOptionalLiteral.txt
new file mode 100644
index 0000000..41c0fdc
--- /dev/null
+++ b/dhall/src/errors/InvalidOptionalLiteral.txt
@@ -0,0 +1,53 @@
+Explanation: The syntax for ❰Optional❱ values resembles the syntax for ❰List❱s:
+
+
+ ┌───────────────────────┐
+ │ [] : Optional Integer │ An ❰Optional❱ value which is absent
+ └───────────────────────┘
+
+
+ ┌───────────────────────┐
+ │ [] : List Integer │ An empty (0-element) ❰List❱
+ └───────────────────────┘
+
+
+ ┌────────────────────────┐
+ │ [1] : Optional Integer │ An ❰Optional❱ value which is present
+ └────────────────────────┘
+
+
+ ┌────────────────────────┐
+ │ [1] : List Integer │ A singleton (1-element) ❰List❱
+ └────────────────────────┘
+
+
+However, an ❰Optional❱ value can $_NOT have more than one element, whereas a
+❰List❱ can have multiple elements:
+
+
+ ┌───────────────────────────┐
+ │ [1, 2] : Optional Integer │ Invalid: multiple elements $_NOT allowed
+ └───────────────────────────┘
+
+
+ ┌───────────────────────────┐
+ │ [1, 2] : List Integer │ Valid: multiple elements allowed
+ └───────────────────────────┘
+
+
+Your ❰Optional❱ value had this many elements:
+
+↳ $txt0
+
+... when an ❰Optional❱ value can only have at most one element
+
+Some common reasons why you might get this error:
+
+● You accidentally typed ❰Optional❱ when you meant ❰List❱, like this:
+
+
+ ┌────────────────────────────────────────────────────┐
+ │ List/length Integer ([1, 2, 3] : Optional Integer) │
+ └────────────────────────────────────────────────────┘
+ ⇧
+ This should be ❰List❱ instead