diff options
author | Nadrieril | 2019-05-06 23:17:26 +0200 |
---|---|---|
committer | Nadrieril | 2019-05-06 23:20:47 +0200 |
commit | 60129b7d1c0ea8bdf2ec666fa51957e97465e88f (patch) | |
tree | 2118155537989a1a3bfa6c51b5c476651a0ef93e /dhall/src/error/text/InvalidPredicate.txt | |
parent | 423fdeebe9247b16744fae4b50df415bbd08be04 (diff) |
Consolidate errors in the error module
Diffstat (limited to 'dhall/src/error/text/InvalidPredicate.txt')
-rw-r--r-- | dhall/src/error/text/InvalidPredicate.txt | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/dhall/src/error/text/InvalidPredicate.txt b/dhall/src/error/text/InvalidPredicate.txt new file mode 100644 index 0000000..4c15881 --- /dev/null +++ b/dhall/src/error/text/InvalidPredicate.txt @@ -0,0 +1,51 @@ +Explanation: Every ❰if❱ expression begins with a predicate which must have type +❰Bool❱ + +For example, these are valid ❰if❱ expressions: + + + ┌──────────────────────────────┐ + │ if True then "Yes" else "No" │ + └──────────────────────────────┘ + ⇧ + Predicate + + + ┌─────────────────────────────────────────┐ + │ λ(x : Bool) → if x then False else True │ + └─────────────────────────────────────────┘ + ⇧ + Predicate + + +... but these are $_NOT valid ❰if❱ expressions: + + + ┌───────────────────────────┐ + │ if 0 then "Yes" else "No" │ ❰0❱ does not have type ❰Bool❱ + └───────────────────────────┘ + + + ┌────────────────────────────┐ + │ if "" then False else True │ ❰""❱ does not have type ❰Bool❱ + └────────────────────────────┘ + + +Your ❰if❱ expression begins with the following predicate: + +↳ $txt0 + +... that has type: + +↳ $txt1 + +... but the predicate must instead have type ❰Bool❱ + +Some common reasons why you might get this error: + +● You might be used to other programming languages that accept predicates other + than ❰Bool❱ + + For example, some languages permit ❰0❱ or ❰""❱ as valid predicates and treat + them as equivalent to ❰False❱. However, the Dhall language does not permit + this |