Don't print out bare constructor

Instead convert to PrimObject
This commit is contained in:
greg 2019-08-05 01:07:48 -07:00
parent ee87695626
commit 87ecc6f0cb
1 changed files with 2 additions and 6 deletions

View File

@ -123,12 +123,8 @@ impl Expr {
UserDefined { name: None, .. } => format!("<function>"),
UserDefined { name: Some(name), .. } => format!("<function '{}'>", name),
},
Expr::Constructor {
type_name: _, name, arity, ..
} => if *arity == 0 {
format!("{}", name)
} else {
format!("<data constructor '{}'>", name)
Expr::Constructor { type_name, arity, .. } => {
format!("<constructor for `{}` arity {}>", type_name, arity)
},
Expr::Tuple(exprs) => paren_wrapped_vec(exprs.iter().map(|x| x.to_repl())),
_ => format!("{:?}", self),