aboutsummaryrefslogtreecommitdiff
path: root/src/type/util.rs
blob: 85e64f1ef266bff3fe6fb48db4fec6fd6944b813 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14

use crate::r#type::{*, Type::*};

pub fn arr(a: impl Into<Box<Type>>, b: impl Into<Box<Type>>) -> Type {
    Arrow(a.into(), b.into())
}

pub fn vt(name: &str) -> Type {
    VarType(name.to_string())
}

pub fn vecof(ty: impl Into<Box<Type>>) -> Type {
    VecOf(ty.into())
}