From 3271619ff7197b0c0db403d85baf3567193ce104 Mon Sep 17 00:00:00 2001 From: Brent Yorgey Date: Wed, 7 Feb 2024 13:21:17 -0600 Subject: [PATCH] use syntax `T` and `F` for true and false Booleans Closes #373. --- src/Disco/AST/Surface.hs | 2 +- src/Disco/Parser.hs | 6 +- src/Disco/Value.hs | 4 +- test/arith-count/expected | 6 +- test/arith-numthry/expected | 20 ++--- test/containers-cmp/expected | 4 +- test/containers-ops/expected | 44 +++++----- test/containers-reduce/expected | 4 +- test/error-tyargs/error-tyargs.disco | 2 +- test/error-tyargs/expected | 6 +- test/error-tyargs/input | 8 +- test/error-unboundtyvar/expected | 2 +- test/error-unboundtyvar/unboundtyvar.disco | 2 +- test/graphs-equality/expected | 8 +- test/list-poly/expected | 2 +- test/logic-bools/expected | 66 +++++++------- test/logic-bools/input | 2 + test/logic-cmp/expected | 86 +++++++++---------- test/map-compare/expected | 8 +- test/parse-320/expected | 2 +- test/parse-case-expr/expected | 2 +- test/poly-instantiate/expected | 2 +- test/pretty-ops/expected | 2 +- test/pretty-type/expected | 2 +- test/prop-fairness/expected | 8 +- test/prop-higher-order/expected | 4 +- test/prop-holds/expected | 14 +-- .../prop-impredicative.disco | 2 +- test/prop-type/expected | 6 +- test/repl-defn/expected | 2 +- test/repl-import/expected | 2 +- test/repl-proptest/expected | 10 +-- test/syntax-chain/expected | 28 +++--- test/syntax-decimals/expected | 2 +- test/syntax-lambda/expected | 2 +- test/syntax-types/expected | 2 +- test/types-char-string/expected | 4 +- test/types-compare/expected | 2 +- test/types-ops/expected | 6 +- test/types-standalone-ops/expected | 6 +- test/types-tydef-param/expected | 2 +- .../types-tydef-param/types-tydef-param.disco | 2 +- test/types-tydef-qual/tydef-qual.disco | 8 +- 43 files changed, 205 insertions(+), 199 deletions(-) diff --git a/src/Disco/AST/Surface.hs b/src/Disco/AST/Surface.hs index 7646e8d9..3643d7ea 100644 --- a/src/Disco/AST/Surface.hs +++ b/src/Disco/AST/Surface.hs @@ -543,7 +543,7 @@ instance Pretty Term where Nothing -> error $ "pretty @Term: Prim " ++ show p ++ " is not in the primMap!" TParens t -> pretty t TUnit -> text "■" - (TBool b) -> text (map toLower $ show b) + (TBool b) -> text (take 1 $ show b) TChar c -> text (show c) TString cs -> doubleQuotes $ text cs TAbs q bnd -> withPA initPA $ diff --git a/src/Disco/Parser.hs b/src/Disco/Parser.hs index 8f403c7f..1d231e86 100644 --- a/src/Disco/Parser.hs +++ b/src/Disco/Parser.hs @@ -399,6 +399,8 @@ reservedWords = , "false" , "True" , "False" + , "T" + , "F" , "let" , "in" , "is" @@ -695,8 +697,8 @@ parseAtom :: Parser Term parseAtom = label "expression" $ parseUnit - <|> TBool True <$ (reserved "true" <|> reserved "True") - <|> TBool False <$ (reserved "false" <|> reserved "False") + <|> TBool True <$ (reserved "true" <|> reserved "True" <|> reserved "T") + <|> TBool False <$ (reserved "false" <|> reserved "False" <|> reserved "F") <|> TChar <$> lexeme (between (char '\'') (char '\'') L.charLiteral) <|> TString <$> lexeme (char '"' >> manyTill L.charLiteral (char '"')) <|> TWild <$ try parseWild diff --git a/src/Disco/Value.hs b/src/Disco/Value.hs index e8358117..503f6955 100644 --- a/src/Disco/Value.hs +++ b/src/Disco/Value.hs @@ -79,7 +79,7 @@ import qualified Prelude as P import Control.Monad (forM) import Data.Bifunctor (first) -import Data.Char (chr, ord, toLower) +import Data.Char (chr, ord) import Data.IntMap (IntMap) import qualified Data.IntMap as IM import Data.List (foldl') @@ -471,7 +471,7 @@ prettyValue (TyUser x args) v = do prettyValue (body args) v prettyValue _ VUnit = "■" prettyValue TyProp _ = prettyPlaceholder TyProp -prettyValue TyBool (VInj s _) = text $ map toLower (show (s == R)) +prettyValue TyBool (VInj s _) = text $ take 1 (show (s == R)) prettyValue TyBool v = error $ "Non-VInj passed with Bool type to prettyValue: " ++ show v prettyValue TyC (vchar -> c) = text (show c) diff --git a/test/arith-count/expected b/test/arith-count/expected index 491d6e0b..e1a554f8 100644 --- a/test/arith-count/expected +++ b/test/arith-count/expected @@ -17,10 +17,10 @@ 1 10 45 -true -true +T +T 12600 -true +T 2520 0 3628800 diff --git a/test/arith-numthry/expected b/test/arith-numthry/expected index eddbd2e4..ded91e72 100644 --- a/test/arith-numthry/expected +++ b/test/arith-numthry/expected @@ -1,12 +1,12 @@ 3 3 -true -true -true -true -true -false -false -false -true -true +T +T +T +T +T +F +F +F +T +T diff --git a/test/containers-cmp/expected b/test/containers-cmp/expected index b096be4c..76a742d9 100644 --- a/test/containers-cmp/expected +++ b/test/containers-cmp/expected @@ -1,4 +1,4 @@ {{1, 2}, {1, 3}, {2, 3}} -true +T {⟅1 # 3⟆, ⟅2 # 5⟆} -true +T diff --git a/test/containers-ops/expected b/test/containers-ops/expected index 4fc9cd89..a9e4020b 100644 --- a/test/containers-ops/expected +++ b/test/containers-ops/expected @@ -8,9 +8,9 @@ {(1, 10), (1, 20), (1, 30), (2, 10), (2, 20), (2, 30)} {(1, 10), (1, 20), (1, 30), (2, 10), (2, 20), (2, 30)} {1} -true -true -true +T +T +T {{}, {1}, {1, 2}, {1, 2, 3}, {1, 3}, {2}, {2, 3}, {3}} {{}} {{}, {1}} @@ -29,31 +29,31 @@ bag([2, -3]) union bag([1 / 2]) : Bag(ℚ) ⟅⟆ ⟅2 # 2, 3, 5⟆ ⟅1⟆ -true -true -true +T +T +T ⟅⟅⟆⟆ ⟅⟅⟆, ⟅1⟆⟆ ⟅⟅⟆, ⟅1⟆, ⟅1, 2⟆, ⟅2⟆⟆ ⟅⟅⟆, ⟅'a'⟆, ⟅'a', 'b'⟆ # 2, ⟅'a', 'b' # 2⟆, ⟅'b'⟆ # 2, ⟅'b' # 2⟆⟆ ⟅⟅⟆, ⟅'a'⟆ # 2, ⟅'a', 'b'⟆ # 6, ⟅'a', 'b' # 2⟆ # 6, ⟅'a', 'b' # 3⟆ # 2, ⟅'a' # 2⟆, ⟅'a' # 2, 'b'⟆ # 3, ⟅'a' # 2, 'b' # 2⟆ # 3, ⟅'a' # 2, 'b' # 3⟆, ⟅'b'⟆ # 3, ⟅'b' # 2⟆ # 3, ⟅'b' # 3⟆⟆ [(2, 3), (2, 4), (2, 4), (1, 3), (1, 4), (1, 4)] -true -true -false -false -true -false -false -true -true -true -false -false -true -false -true -true +T +T +F +F +T +F +F +T +T +T +F +F +T +F +T +T ⟅'x' # 3, 'y' # 2⟆ ⟅'x' # 3, 'y'⟆ ⟅'x', 'y'⟆ diff --git a/test/containers-reduce/expected b/test/containers-reduce/expected index 1ce72538..9d072b8e 100644 --- a/test/containers-reduce/expected +++ b/test/containers-reduce/expected @@ -8,8 +8,8 @@ reduce : (a × a → a) × a × List(a) → a reduce(~+~, 0, [1 .. 10]) : ℕ 55 60 -true +T 2351 6 7 -true +T diff --git a/test/error-tyargs/error-tyargs.disco b/test/error-tyargs/error-tyargs.disco index 125a334c..39396b93 100644 --- a/test/error-tyargs/error-tyargs.disco +++ b/test/error-tyargs/error-tyargs.disco @@ -1 +1 @@ -type T(a,b) = Unit + a*b +type X(a,b) = Unit + a*b diff --git a/test/error-tyargs/expected b/test/error-tyargs/expected index e0d8c081..21cc50f4 100644 --- a/test/error-tyargs/expected +++ b/test/error-tyargs/expected @@ -1,10 +1,10 @@ Loading error-tyargs.disco... Loaded. -Error: not enough arguments for the type 'T'. +Error: not enough arguments for the type 'X'. https://disco-lang.readthedocs.io/en/latest/reference/num-args-type.html -Error: not enough arguments for the type 'T'. +Error: not enough arguments for the type 'X'. https://disco-lang.readthedocs.io/en/latest/reference/num-args-type.html -Error: too many arguments for the type 'T'. +Error: too many arguments for the type 'X'. https://disco-lang.readthedocs.io/en/latest/reference/num-args-type.html Error: not enough arguments for the type 'List'. https://disco-lang.readthedocs.io/en/latest/reference/num-args-type.html diff --git a/test/error-tyargs/input b/test/error-tyargs/input index 78fe519f..cadbfd45 100644 --- a/test/error-tyargs/input +++ b/test/error-tyargs/input @@ -1,7 +1,7 @@ :load test/error-tyargs/error-tyargs.disco -x : T -y : T(Int) -z : T(Int,Char) -w : T(Int,Char,Bool) +x : X +y : X(Int) +z : X(Int,Char) +w : X(Int,Char,Bool) q : List p : List(Int,Char) \ No newline at end of file diff --git a/test/error-unboundtyvar/expected b/test/error-unboundtyvar/expected index 708ff422..06cb5f2a 100644 --- a/test/error-unboundtyvar/expected +++ b/test/error-unboundtyvar/expected @@ -1,4 +1,4 @@ Loading unboundtyvar.disco... -While checking unboundtyvar.T: +While checking unboundtyvar.Ty: Error: Unknown type variable 'b'. https://disco-lang.readthedocs.io/en/latest/reference/unbound-tyvar.html diff --git a/test/error-unboundtyvar/unboundtyvar.disco b/test/error-unboundtyvar/unboundtyvar.disco index 45c114aa..f4b69db6 100644 --- a/test/error-unboundtyvar/unboundtyvar.disco +++ b/test/error-unboundtyvar/unboundtyvar.disco @@ -1 +1 @@ -type T(a) = a + b +type Ty(a) = a + b diff --git a/test/graphs-equality/expected b/test/graphs-equality/expected index 1140ff52..aecde616 100644 --- a/test/graphs-equality/expected +++ b/test/graphs-equality/expected @@ -1,4 +1,4 @@ -true -true -true -true +T +T +T +T diff --git a/test/list-poly/expected b/test/list-poly/expected index e9c03e04..aab9eb17 100644 --- a/test/list-poly/expected +++ b/test/list-poly/expected @@ -12,7 +12,7 @@ [10, 9, 8, 7, 6] [1, 3, 6, 10, 15, 21] [1, 4, 9, 16, 25, 36] -true +T [] [1, 3, 4, 4, 3, 1, -2, -6, -11, -17] [1, 3/2, 2, 5/2, 3] diff --git a/test/logic-bools/expected b/test/logic-bools/expected index 90f385ff..fb0451fd 100644 --- a/test/logic-bools/expected +++ b/test/logic-bools/expected @@ -1,32 +1,34 @@ -true -false -true -false -true -false -false -false -false -false -true -true -true -false -true -true -false -true -true -false -true -true -true -false -true -true -true -false -false -true -false -false +T +F +T +F +T +F +T +F +F +F +F +F +T +T +T +F +T +T +F +T +T +F +T +T +T +F +T +T +T +F +F +T +F +F diff --git a/test/logic-bools/input b/test/logic-bools/input index d09bebc5..2f0c7e30 100644 --- a/test/logic-bools/input +++ b/test/logic-bools/input @@ -2,6 +2,8 @@ true false True False +T +F true and true true and false false and true diff --git a/test/logic-cmp/expected b/test/logic-cmp/expected index 4482d2b7..f6986a5b 100644 --- a/test/logic-cmp/expected +++ b/test/logic-cmp/expected @@ -1,46 +1,46 @@ -true -false -false -true -true -true -false -false -true -false -false -true -true -false -false -false -true -true -false -true -false -true -true -false -true -false -true -false -false -true -true -true -false -true -false -true -true -false -true -true -false -false -true +T +F +F +T +T +T +F +F +T +F +F +T +T +F +F +F +T +T +F +T +F +T +T +F +T +F +T +F +F +T +T +T +F +T +F +T +T +F +T +T +F +F +T 3 5 1 diff --git a/test/map-compare/expected b/test/map-compare/expected index 1140ff52..aecde616 100644 --- a/test/map-compare/expected +++ b/test/map-compare/expected @@ -1,4 +1,4 @@ -true -true -true -true +T +T +T +T diff --git a/test/parse-320/expected b/test/parse-320/expected index 83610fff..1fc98e87 100644 --- a/test/parse-320/expected +++ b/test/parse-320/expected @@ -1,4 +1,4 @@ -false +F Error: there is nothing named nottrue. https://disco-lang.readthedocs.io/en/latest/reference/unbound.html 5 diff --git a/test/parse-case-expr/expected b/test/parse-case-expr/expected index 7639083f..041057be 100644 --- a/test/parse-case-expr/expected +++ b/test/parse-case-expr/expected @@ -1 +1 @@ -[false, false] +[F, F] diff --git a/test/poly-instantiate/expected b/test/poly-instantiate/expected index b1b77f39..addfd736 100644 --- a/test/poly-instantiate/expected +++ b/test/poly-instantiate/expected @@ -7,6 +7,6 @@ foldr(λx. λy. x + 1) : ℕ → List(ℕ) → ℕ foldr(λx. λy. y + 1) : ℕ → List(a) → ℕ foldr(λx. λy. y + 1)(1) : List(a) → ℕ foldr(λx. λy. y + 1)(-1) : List(a) → ℤ -foldr(λx. λy. x)(false) : List(Bool) → Bool +foldr(λx. λy. x)(F) : List(Bool) → Bool foldr(λx. λy. x + 1)(1 / 2) : List(ℕ) → 𝔽 foldr(λx. λy. x - 1)(1 / 2) : List(ℤ) → ℚ diff --git a/test/pretty-ops/expected b/test/pretty-ops/expected index 1164734f..785a1b0e 100644 --- a/test/pretty-ops/expected +++ b/test/pretty-ops/expected @@ -1,4 +1,4 @@ -not true +not T 5! 6 + 3 6 + 5 * 2 diff --git a/test/pretty-type/expected b/test/pretty-type/expected index 89edfcf5..111f0c76 100644 --- a/test/pretty-type/expected +++ b/test/pretty-type/expected @@ -1,3 +1,3 @@ [1, 2, 3, 4] : List(ℕ) [[1, 2], [3, 4]] : List(List(ℕ)) -[[(2, true), (3, false)], [(-5, true)]] : List(List(ℤ × Bool)) +[[(2, T), (3, F)], [(-5, T)]] : List(List(ℤ × Bool)) diff --git a/test/prop-fairness/expected b/test/prop-fairness/expected index fc2b492b..a9f56342 100644 --- a/test/prop-fairness/expected +++ b/test/prop-fairness/expected @@ -1,4 +1,4 @@ -false -true -true -true +F +T +T +T diff --git a/test/prop-higher-order/expected b/test/prop-higher-order/expected index 131dd2ae..32d7fdb6 100644 --- a/test/prop-higher-order/expected +++ b/test/prop-higher-order/expected @@ -2,9 +2,9 @@ Loading higher-order.disco... Loaded. - Possibly true: ∀x. x =!= 0 \/ (∃n. n * x >= 1) Checked 100 possibilities without finding a counterexample. - - Certainly true: ∀f. any([∀x. f(x) =!= not x, ∀x. f(x) =!= x, ∀x. f(x) =!= false, ∀x. f(x) =!= true]) + - Certainly true: ∀f. any([∀x. f(x) =!= not x, ∀x. f(x) =!= x, ∀x. f(x) =!= F, ∀x. f(x) =!= T]) No counterexamples exist; all possible values were checked. - - Certainly false: all([true, true, true, false, true]) + - Certainly false: all([T, T, T, F, T]) - Certainly true: ∃k. hasFactors(2 ^ k + 1) Found example: k = 3 diff --git a/test/prop-holds/expected b/test/prop-holds/expected index 09c71ba6..a4517737 100644 --- a/test/prop-holds/expected +++ b/test/prop-holds/expected @@ -1,7 +1,7 @@ -true -true -true -false -false -true -true +T +T +T +F +F +T +T diff --git a/test/prop-impredicative/prop-impredicative.disco b/test/prop-impredicative/prop-impredicative.disco index 455fc078..e6cc96f4 100644 --- a/test/prop-impredicative/prop-impredicative.disco +++ b/test/prop-impredicative/prop-impredicative.disco @@ -1 +1 @@ -type T(a) = Unit + a * T(a) * T(a) +type Tree(a) = Unit + a * Tree(a) * Tree(a) diff --git a/test/prop-type/expected b/test/prop-type/expected index a888b033..d09a951d 100644 --- a/test/prop-type/expected +++ b/test/prop-type/expected @@ -4,6 +4,6 @@ ∃x : ℕ. ∃y : ℕ. x > y : Prop ∀x : ℕ, y : ℕ, z : ℕ. x + y + z == x + (y + z) : Prop ∃x : ℕ. ∀y : ℕ. x <= y : Prop -not(∀x : Bool. true \/ x) : Prop -(∀x : Void. false) /\ true : Prop -(∀x : Void. false) \/ true : Prop +not(∀x : Bool. T \/ x) : Prop +(∀x : Void. F) /\ T : Prop +(∀x : Void. F) \/ T : Prop diff --git a/test/repl-defn/expected b/test/repl-defn/expected index 8fee26e6..dac71f52 100644 --- a/test/repl-defn/expected +++ b/test/repl-defn/expected @@ -1,4 +1,4 @@ 5 x : ℕ -true +T 6 diff --git a/test/repl-import/expected b/test/repl-import/expected index 9cb8779d..4a554f8f 100644 --- a/test/repl-import/expected +++ b/test/repl-import/expected @@ -1,3 +1,3 @@ Loading num.disco... -false +F [4, 5] diff --git a/test/repl-proptest/expected b/test/repl-proptest/expected index 52a7b04e..83dbc320 100644 --- a/test/repl-proptest/expected +++ b/test/repl-proptest/expected @@ -1,12 +1,12 @@ - - Certainly true: not false + - Certainly true: not F - Certainly true: {1, 2} =!= {2, 1} - Left side: {1, 2} - Right side: {1, 2} - Certainly true: ∃a, b. (a /\ b) =!= (a \/ b) Found example: - a = false - b = false + a = F + b = F - Certainly false: ∀a, b. (a /\ b) =!= (a \/ b) Found counterexample: - a = false - b = true + a = F + b = T diff --git a/test/syntax-chain/expected b/test/syntax-chain/expected index d5393242..8b2272e1 100644 --- a/test/syntax-chain/expected +++ b/test/syntax-chain/expected @@ -1,16 +1,16 @@ Loading inRange.disco... Loaded. -false -false -true -true -true -false -true -false -false -false -false -false -false -false +F +F +T +T +T +F +T +F +F +F +F +F +F +F diff --git a/test/syntax-decimals/expected b/test/syntax-decimals/expected index 5d806028..a1480fd6 100644 --- a/test/syntax-decimals/expected +++ b/test/syntax-decimals/expected @@ -11,7 +11,7 @@ 1.5 22.7 3.8[3] -true +T 0.[142857] 0.[052631578947368421] 0.[032258064516129] diff --git a/test/syntax-lambda/expected b/test/syntax-lambda/expected index 9dc388c5..4a671419 100644 --- a/test/syntax-lambda/expected +++ b/test/syntax-lambda/expected @@ -7,7 +7,7 @@ let f = λx. x + 1 : ℕ in f : ℕ → ℕ (9, 8) 5 λx : ℤ. λy : ℕ. x * y : ℤ → ℕ → ℤ -[false, true, true] +[F, T, T] let f = λg : ℤ → ℕ → Bool. [g(1)(1), g(1)(2), g(-1)(0)] in f(λx. λy : ℤ. x + 1 == y) : List(Bool) 3 TAbs_ Lam () (<[PWild_ ()]> TNat_ () 3) diff --git a/test/syntax-types/expected b/test/syntax-types/expected index 590d0386..bb894fb1 100644 --- a/test/syntax-types/expected +++ b/test/syntax-types/expected @@ -2,7 +2,7 @@ [-1, -1, -1, -1] [1/2, 1/2] [-1/2, -1/2, -1/2] -[true, true] +[T, T] [■, ■] [] {} diff --git a/test/types-char-string/expected b/test/types-char-string/expected index c8da8ccd..9e96fefc 100644 --- a/test/types-char-string/expected +++ b/test/types-char-string/expected @@ -7,7 +7,7 @@ '#' '\\' '"' -true +T 1 2 3 @@ -29,6 +29,6 @@ expecting ''' "'" "a\na\a\a\"" "\\" -true +T 2 1 diff --git a/test/types-compare/expected b/test/types-compare/expected index 27ba77dd..62a6e3c9 100644 --- a/test/types-compare/expected +++ b/test/types-compare/expected @@ -1 +1 @@ -true +T diff --git a/test/types-ops/expected b/test/types-ops/expected index 24470edf..8c8c2396 100644 --- a/test/types-ops/expected +++ b/test/types-ops/expected @@ -13,12 +13,12 @@ right(0) right(1) [] [, , , ] -[left(false, false), left(false, true), left(true, false), left(true, true), right(false), right(true)] -[left(■), right(false), right(true)] +[left(F, F), left(F, T), left(T, F), left(T, T), right(F), right(T)] +[left(■), right(F), right(T)] [] [[]] [[]] -[false, true] +[F, T] [[], [■], [■, ■], [■, ■, ■], [■, ■, ■, ■]] [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] [(0, 0), (0, 1), (1, 0), (0, 2), (1, 1), (2, 0)] diff --git a/test/types-standalone-ops/expected b/test/types-standalone-ops/expected index f44cc96c..a1ec4246 100644 --- a/test/types-standalone-ops/expected +++ b/test/types-standalone-ops/expected @@ -1,4 +1,4 @@ ~/\~ : Bool × Bool → Bool -false /\ true : Bool -λx. x /\ true : Bool → Bool -let f : (Bool × Bool → Bool) → Bool = λg. g(true, false) in f(~/\~) : Bool +F /\ T : Bool +λx. x /\ T : Bool → Bool +let f : (Bool × Bool → Bool) → Bool = λg. g(T, F) in f(~/\~) : Bool diff --git a/test/types-tydef-param/expected b/test/types-tydef-param/expected index c0fcd421..cfb84b74 100644 --- a/test/types-tydef-param/expected +++ b/test/types-tydef-param/expected @@ -2,7 +2,7 @@ Loading types-tydef-param.disco... Loaded. right(5, right(2, left(■), left(■)), right(7, right(1, left(■), left(■)), left(■))) 15 -right(3, right(true, right(5, right(false, right(7, left(■)))))) +right(3, right(T, right(5, right(F, right(7, left(■)))))) 15 type Maybe(a) = Unit + a type Tree(a) = Unit + a × Tree(a) × Tree(a) diff --git a/test/types-tydef-param/types-tydef-param.disco b/test/types-tydef-param/types-tydef-param.disco index 4b1dd68a..806afe1e 100644 --- a/test/types-tydef-param/types-tydef-param.disco +++ b/test/types-tydef-param/types-tydef-param.disco @@ -27,7 +27,7 @@ t = right (5, right (2, left(■), left(■)), right (7, right (1, left(■), le type AltList(a,b) = Unit + a * AltList(b,a) alt1 : AltList(N, Bool) -alt1 = right (3, right (true, right (5, right (false, right (7, left(■)))))) +alt1 = right (3, right (T, right (5, right (F, right (7, left(■)))))) foldAltList : r -> (a * r -> r) -> (b * r -> r) -> AltList(a, b) -> r foldAltList z _ _ (left(■)) = z diff --git a/test/types-tydef-qual/tydef-qual.disco b/test/types-tydef-qual/tydef-qual.disco index 4758f7c7..fdeeb9e4 100644 --- a/test/types-tydef-qual/tydef-qual.disco +++ b/test/types-tydef-qual/tydef-qual.disco @@ -4,15 +4,15 @@ type S = List(Char) x : S x = "hi" -type T(a) = Unit + a * T(a) * T(a) +type Tree(a) = Unit + a * Tree(a) * Tree(a) -leaf : T(a) +leaf : Tree(a) leaf = left(unit) -testT : T(N) +testT : Tree(N) testT = right(3, right(4, right(1, leaf, leaf), right(6, leaf, leaf)), right(9, leaf, leaf)) !!! mirror(mirror(testT)) == testT -mirror : T(a) -> T(a) +mirror : Tree(a) -> Tree(a) mirror(left(unit)) = left(unit) mirror(right(a,l,r)) = right(a, mirror(r), mirror(l))