Don't print out bare constructor
Instead convert to PrimObject
This commit is contained in:
parent
ee87695626
commit
87ecc6f0cb
@ -123,12 +123,8 @@ impl Expr {
|
|||||||
UserDefined { name: None, .. } => format!("<function>"),
|
UserDefined { name: None, .. } => format!("<function>"),
|
||||||
UserDefined { name: Some(name), .. } => format!("<function '{}'>", name),
|
UserDefined { name: Some(name), .. } => format!("<function '{}'>", name),
|
||||||
},
|
},
|
||||||
Expr::Constructor {
|
Expr::Constructor { type_name, arity, .. } => {
|
||||||
type_name: _, name, arity, ..
|
format!("<constructor for `{}` arity {}>", type_name, arity)
|
||||||
} => if *arity == 0 {
|
|
||||||
format!("{}", name)
|
|
||||||
} else {
|
|
||||||
format!("<data constructor '{}'>", name)
|
|
||||||
},
|
},
|
||||||
Expr::Tuple(exprs) => paren_wrapped_vec(exprs.iter().map(|x| x.to_repl())),
|
Expr::Tuple(exprs) => paren_wrapped_vec(exprs.iter().map(|x| x.to_repl())),
|
||||||
_ => format!("{:?}", self),
|
_ => format!("{:?}", self),
|
||||||
|
Loading…
Reference in New Issue
Block a user