Skip to content

Eq and Ord classes don't seem very useful #447

@treeowl

Description

@treeowl

I could be wrong, but it seems to be that having == and (probably) compare consume their arguments is wrong for the vast majority of types that need to be handled linearly. I would expect something more like

class Eq a where
  (==) :: a %1-> a %1-> (Bool, a, a) -- return both values in case `==` is not structural equality
class Eq a => Ord a where
  compare :: a %1-> a %1-> (Ordering, a, a)
  (<=) :: a %1-> a %1-> (Bool, a, a)
  ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions