diff options
Diffstat (limited to 'src/type/util.rs')
-rw-r--r-- | src/type/util.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/type/util.rs b/src/type/util.rs index ad85b79..d95629d 100644 --- a/src/type/util.rs +++ b/src/type/util.rs @@ -14,6 +14,19 @@ pub fn vecof(ty: impl Into<Box<Type>>) -> Type { VecOf(ty.into()) } +impl Type { + pub fn is_quoted_or_vectored_list(&self) -> bool { + match self { + List(v) => match v.get(0) { + Some(VecType) => true, + Some(QuoteTy) => true, + _ => false, + }, + _ => false, + } + } +} + use crate::sexp::{SExp::*, SLeaf::*}; impl SExp { pub fn get_fun_type(self, mut ctx: HashMap<String, Type>) -> Result<Type, TypeError> { |