diff options
author | Joel Kronqvist <joel.kronqvist@iki.fi> | 2025-08-19 13:55:05 +0300 |
---|---|---|
committer | Joel Kronqvist <joel.kronqvist@iki.fi> | 2025-08-19 13:55:05 +0300 |
commit | a70dcaa949f41c585f9aea5e79f2550053d8e857 (patch) | |
tree | 9366f0b1e026c009708ebc243d006a79cbf452c9 /src/type/util.rs | |
parent | d4d6e972650370d529363f7db3946e58bdbd7bca (diff) | |
download | myslip-a70dcaa949f41c585f9aea5e79f2550053d8e857.tar.gz myslip-a70dcaa949f41c585f9aea5e79f2550053d8e857.zip |
test: added boilerplate and tests for coproduct parsing, type checking and evaluation
Diffstat (limited to 'src/type/util.rs')
-rw-r--r-- | src/type/util.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/type/util.rs b/src/type/util.rs index 04b4ee6..0ea1e4d 100644 --- a/src/type/util.rs +++ b/src/type/util.rs @@ -6,6 +6,10 @@ pub fn arr(a: impl Into<Box<Type>>, b: impl Into<Box<Type>>) -> Type { Arrow(a.into(), b.into()) } +pub fn sumtype(a: impl Into<Box<Type>>, b: impl Into<Box<Type>>) -> Type { + SumType(a.into(), b.into()) +} + pub fn vt(name: &str) -> Type { VarType(name.to_string()) } |