Skip to content

Add Trait implementation #6

@J3RN

Description

@J3RN

Again, Haskell has rather bad syntax for this:

instance Show Bool where
  show True -> "True"
  show False -> "False"

Rust:

impl Show for Bool {
  fn show(b) -> String {
     match (b) {
       true -> "true"
       false -> "false"
     }
   }
}

I think Rust's is closer to what I want when the extraneous parts are cut out:

impl Show for Bool {
  show = (b) => {
    match (b) {
      True -> "True"
      False -> "False"
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions