aboutsummaryrefslogtreecommitdiff
path: root/stdlib/test
diff options
context:
space:
mode:
authorEduardo Julian2017-05-07 12:17:27 -0400
committerEduardo Julian2017-05-07 12:17:27 -0400
commit4744552df1f1285d600a13ed0a3cf8be2f336030 (patch)
tree69d4d2f1a8766b1e961a01caa00a26617f35246a /stdlib/test
parent42848dd5a3b2e1d02752201343e18f075a733645 (diff)
- Removed "T" suffix from Type's tags.
Diffstat (limited to 'stdlib/test')
-rw-r--r--stdlib/test/test/lux/type.lux14
-rw-r--r--stdlib/test/test/lux/type/check.lux52
2 files changed, 33 insertions, 33 deletions
diff --git a/stdlib/test/test/lux/type.lux b/stdlib/test/test/lux/type.lux
index 705306150..77858e7fa 100644
--- a/stdlib/test/test/lux/type.lux
+++ b/stdlib/test/test/lux/type.lux
@@ -55,15 +55,15 @@
(do Monad<Maybe>
[partial (&;apply-type Meta Bool)
full (&;apply-type partial Int)]
- (wrap (:: &;Eq<Type> = full (#;ProdT Bool Int)))))
+ (wrap (:: &;Eq<Type> = full (#;Product Bool Int)))))
(|> (&;apply-type Text Bool)
(case> #;None true _ false)))))
(test: "Naming"
- (let [base (#;NamedT ["" "a"] (#;ProdT Bool Int))
- aliased (#;NamedT ["" "c"]
- (#;NamedT ["" "b"]
- base))]
+ (let [base (#;Named ["" "a"] (#;Product Bool Int))
+ aliased (#;Named ["" "c"]
+ (#;Named ["" "b"]
+ base))]
($_ seq
(assert "Can remove aliases from an already-named type."
(:: &;Eq<Type> =
@@ -83,7 +83,7 @@
members (|> gen-type
(R;filter (function [type]
(case type
- (^or (#;SumT _) (#;ProdT _))
+ (^or (#;Sum _) (#;Product _))
false
_
@@ -112,7 +112,7 @@
extra (|> gen-type
(R;filter (function [type]
(case type
- (^or (#;FunctionT _) (#;AppT _))
+ (^or (#;Function _) (#;App _))
false
_
diff --git a/stdlib/test/test/lux/type/check.lux b/stdlib/test/test/lux/type/check.lux
index b57bec8e8..8cc8c88d7 100644
--- a/stdlib/test/test/lux/type/check.lux
+++ b/stdlib/test/test/lux/type/check.lux
@@ -46,18 +46,18 @@
(def: (valid-type? type)
(-> Type Bool)
(case type
- (#;HostT name params)
+ (#;Host name params)
(list;every? valid-type? params)
- (^or #;VoidT #;UnitT (#;ExT id))
+ (^or #;Void #;Unit (#;Ex id))
true
(^template [<tag>]
(<tag> left right)
(and (valid-type? left) (valid-type? right)))
- ([#;SumT] [#;ProdT] [#;FunctionT])
+ ([#;Sum] [#;Product] [#;Function])
- (#;NamedT name type')
+ (#;Named name type')
(valid-type? type')
_
@@ -101,32 +101,32 @@
(assert "Names don't affect type-checking."
(and (type-checks? (do &;Monad<Check>
[[id ex] &;existential]
- (&;check (#;NamedT ["module" "name"] ex)
+ (&;check (#;Named ["module" "name"] ex)
ex)))
(type-checks? (do &;Monad<Check>
[[id ex] &;existential]
(&;check ex
- (#;NamedT ["module" "name"] ex))))
+ (#;Named ["module" "name"] ex))))
(type-checks? (do &;Monad<Check>
[[id ex] &;existential]
- (&;check (#;NamedT ["module" "name"] ex)
- (#;NamedT ["module" "name"] ex))))))
+ (&;check (#;Named ["module" "name"] ex)
+ (#;Named ["module" "name"] ex))))))
(assert "Can type-check functions."
- (and (&;checks? (#;FunctionT Bottom Top)
- (#;FunctionT Top Bottom))
- (not (&;checks? (#;FunctionT Top Bottom)
- (#;FunctionT Bottom Top)))))
+ (and (&;checks? (#;Function Bottom Top)
+ (#;Function Top Bottom))
+ (not (&;checks? (#;Function Top Bottom)
+ (#;Function Bottom Top)))))
))
(test: "Type application"
[meta gen-type
data gen-type]
(assert "Can type-check type application."
- (and (&;checks? (#;AppT (#;AppT Meta meta) data)
+ (and (&;checks? (#;App (#;App Meta meta) data)
(type;tuple (list meta data)))
(&;checks? (type;tuple (list meta data))
- (#;AppT (#;AppT Meta meta) data)))))
+ (#;App (#;App Meta meta) data)))))
(test: "Host types"
[nameL gen-name
@@ -135,16 +135,16 @@
paramR (|> gen-type (R;filter (|>. (&;checks? paramL) not)))]
($_ seq
(assert "Host types match when they have the same name and the same parameters."
- (&;checks? (#;HostT nameL (list paramL))
- (#;HostT nameL (list paramL))))
+ (&;checks? (#;Host nameL (list paramL))
+ (#;Host nameL (list paramL))))
(assert "Names matter to host types."
- (not (&;checks? (#;HostT nameL (list paramL))
- (#;HostT nameR (list paramL)))))
+ (not (&;checks? (#;Host nameL (list paramL))
+ (#;Host nameR (list paramL)))))
(assert "Parameters matter to host types."
- (not (&;checks? (#;HostT nameL (list paramL))
- (#;HostT nameL (list paramR)))))
+ (not (&;checks? (#;Host nameL (list paramL))
+ (#;Host nameL (list paramR)))))
))
(test: "Type-vars"
@@ -153,24 +153,24 @@
(type-checks? (&;with-var (function [[id var]] (&;check var var)))))
(assert "Can bind unbound type-vars by type-checking against them."
- (and (type-checks? (&;with-var (function [[id var]] (&;check var #;UnitT))))
- (type-checks? (&;with-var (function [[id var]] (&;check #;UnitT var))))))
+ (and (type-checks? (&;with-var (function [[id var]] (&;check var #;Unit))))
+ (type-checks? (&;with-var (function [[id var]] (&;check #;Unit var))))))
(assert "Can't rebind already bound type-vars."
(not (type-checks? (&;with-var (function [[id var]]
(do &;Monad<Check>
- [_ (&;check var #;UnitT)]
- (&;check var #;VoidT)))))))
+ [_ (&;check var #;Unit)]
+ (&;check var #;Void)))))))
(assert "If the type bound to a var is a super-type to another, then the var is also a super-type."
(type-checks? (&;with-var (function [[id var]]
(do &;Monad<Check>
[_ (&;check var Top)]
- (&;check var #;UnitT))))))
+ (&;check var #;Unit))))))
(assert "If the type bound to a var is a sub-type of another, then the var is also a sub-type."
(type-checks? (&;with-var (function [[id var]]
(do &;Monad<Check>
[_ (&;check var Bottom)]
- (&;check #;UnitT var))))))
+ (&;check #;Unit var))))))
))