Haskell type class morphism [OT]

Recently I’ve seen an article, “Improving Typ e class Relations by Being Open”, by Guido Martínez et al.:

While it’s about Haskell, I think the same ideas could be adapted to Rust traits.

It introduces class morphisms, with a Haskell syntax like:

class morphism Enum -> Eq where
    x == y = fromEnum x == fromEnum y

The article lists some disadvantages and troubles with this idea, but in the whole it looks nice.


This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.