aboutsummaryrefslogtreecommitdiff
path: root/src/type/display.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/type/display.rs')
-rw-r--r--src/type/display.rs22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/type/display.rs b/src/type/display.rs
index 56b22b6..27f1427 100644
--- a/src/type/display.rs
+++ b/src/type/display.rs
@@ -19,21 +19,21 @@ impl fmt::Display for Type {
/// Examples:
/// ```rust
/// use myslip::r#type::{Type::*, util::*};
- /// assert_eq!(Integer.to_string(), "int".to_string());
- /// assert_eq!(Boolean.to_string(), "bool".to_string());
- /// assert_eq!(arr(Integer, Boolean).to_string(), "(int -> bool)".to_string());
- /// assert_eq!(List(vec![Integer, Boolean, Integer]).to_string(), "(int bool int)".to_string());
+ /// assert_eq!(Integer.to_string(), "Int".to_string());
+ /// assert_eq!(Boolean.to_string(), "Bool".to_string());
+ /// assert_eq!(arr(Integer, Boolean).to_string(), "(Int -> Bool)".to_string());
+ /// assert_eq!(List(vec![Integer, Boolean, Integer]).to_string(), "(Int Bool Int)".to_string());
/// ```
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
- Integer => write!(f, "{}", "int"),
- Boolean => write!(f, "{}", "bool"),
+ Integer => write!(f, "{}", "Int"),
+ Boolean => write!(f, "{}", "Bool"),
QuoteTy => write!(f, "{}", "Quote"),
VecType => write!(f, "{}", "Vector"),
LetType => write!(f, "{}", "Let"),
- NilType => write!(f, "()"),
+ NilType => write!(f, "Nil"),
TypeLit => write!(f, "[type literal]"),
- VecOf(ty) => write!(f, "({} ... {})", *ty, *ty),
+ VecOf(ty) => write!(f, "({} ...)", *ty),
Arrow(a, b) => write!(f, "({} -> {})", a, b),
List(types) => write!(
f,
@@ -67,7 +67,7 @@ impl fmt::Display for TypeError {
/// expected: arr(VarType("?".to_string()), VarType("?".to_string())),
/// found: Integer
/// }.to_string(),
- /// "invalid operator: '1'\nexpected: '(? -> ?)'\nfound: 'int'".to_string()
+ /// "invalid operator: '1'\nexpected: '(? -> ?)'\nfound: 'Int'".to_string()
/// );
/// assert_eq!(
/// InvalidArgList {
@@ -75,7 +75,7 @@ impl fmt::Display for TypeError {
/// expected: List(vec![Integer, Integer]),
/// found: List(vec![Integer, Integer, Integer]),
/// }.to_string(),
- /// "invalid argument list: '(1 2 3)'\nexpected: '(int int)'\nfound: '(int int int)'".to_string()
+ /// "invalid argument list: '(1 2 3)'\nexpected: '(Int Int)'\nfound: '(Int Int Int)'".to_string()
/// );
/// assert_eq!(
/// UnboundGeneric(String::from("?")).to_string(),
@@ -86,7 +86,7 @@ impl fmt::Display for TypeError {
/// argtype: Integer,
/// generictype: arr(VarType("T".to_string()), Integer)
/// }.to_string(),
- /// "incompatible argument type 'int' and generic operator type '(T -> int)'".to_string()
+ /// "incompatible argument type 'Int' and generic operator type '(T -> Int)'".to_string()
/// );
/// ```
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {