You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We need to be able to define new Traits. Haskell's typeclass definition looks like:
classShowawhereshow::a->String
There's a variety or reasons why I don't like this syntax.
Rust's trait definition looks like:
pubtraitSummary{fnsummarize(&self) -> String;}
This is closer to what I want (but obviously pub goes away and &self should (not be borrowed) and have a better name like object or something. And I don't like the fn keyword either.
Perhaps something like this:
trait Summary {
summarize : a -> String
}
The text was updated successfully, but these errors were encountered:
We need to be able to define new Traits. Haskell's typeclass definition looks like:
There's a variety or reasons why I don't like this syntax.
Rust's trait definition looks like:
This is closer to what I want (but obviously
pub
goes away and&self
should (not be borrowed) and have a better name likeobject
or something. And I don't like thefn
keyword either.Perhaps something like this:
The text was updated successfully, but these errors were encountered: