diff options
author | Nadrieril | 2019-03-01 17:28:19 +0100 |
---|---|---|
committer | Nadrieril | 2019-03-01 17:28:19 +0100 |
commit | e5d9aee00b0c775df1d8e2d8819aeb80dffa73c2 (patch) | |
tree | e763a24a0d635048232e72e167ca37eafec69369 /src/errors/UnboundVariable.txt | |
parent | 8a2b7536902831079eddd7b00291b718f5dd7186 (diff) |
Split abnf_to_pest and dhall into their own crates
Diffstat (limited to 'src/errors/UnboundVariable.txt')
-rw-r--r-- | src/errors/UnboundVariable.txt | 97 |
1 files changed, 0 insertions, 97 deletions
diff --git a/src/errors/UnboundVariable.txt b/src/errors/UnboundVariable.txt deleted file mode 100644 index bd7d483..0000000 --- a/src/errors/UnboundVariable.txt +++ /dev/null @@ -1,97 +0,0 @@ -Explanation: Expressions can only reference previously introduced (i.e. "bound") -variables that are still "in scope" - -For example, the following valid expressions introduce a "bound" variable named -❰x❱: - - - ┌─────────────────┐ - │ λ(x : Bool) → x │ Anonymous functions introduce "bound" variables - └─────────────────┘ - ⇧ - This is the bound variable - - - ┌─────────────────┐ - │ let x = 1 in x │ ❰let❱ expressions introduce "bound" variables - └─────────────────┘ - ⇧ - This is the bound variable - - -However, the following expressions are not valid because they all reference a -variable that has not been introduced yet (i.e. an "unbound" variable): - - - ┌─────────────────┐ - │ λ(x : Bool) → y │ The variable ❰y❱ hasn't been introduced yet - └─────────────────┘ - ⇧ - This is the unbound variable - - - ┌──────────────────────────┐ - │ (let x = True in x) && x │ ❰x❱ is undefined outside the parentheses - └──────────────────────────┘ - ⇧ - This is the unbound variable - - - ┌────────────────┐ - │ let x = x in x │ The definition for ❰x❱ cannot reference itself - └────────────────┘ - ⇧ - This is the unbound variable - - -Some common reasons why you might get this error: - -● You misspell a variable name, like this: - - - ┌────────────────────────────────────────────────────┐ - │ λ(empty : Bool) → if emty then "Empty" else "Full" │ - └────────────────────────────────────────────────────┘ - ⇧ - Typo - - -● You misspell a reserved identifier, like this: - - - ┌──────────────────────────┐ - │ foral (a : Type) → a → a │ - └──────────────────────────┘ - ⇧ - Typo - - -● You tried to define a recursive value, like this: - - - ┌─────────────────────┐ - │ let x = x + +1 in x │ - └─────────────────────┘ - ⇧ - Recursive definitions are not allowed - - -● You accidentally forgot a ❰λ❱ or ❰∀❱/❰forall❱ - - - Unbound variable - ⇩ - ┌─────────────────┐ - │ (x : Bool) → x │ - └─────────────────┘ - ⇧ - A ❰λ❱ here would transform this into a valid anonymous function - - - Unbound variable - ⇩ - ┌────────────────────┐ - │ (x : Bool) → Bool │ - └────────────────────┘ - ⇧ - A ❰∀❱ or ❰forall❱ here would transform this into a valid function type |