Ticket #472 (new feature request: None)

Opened 8 years ago

Last modified 11 months ago

Supertyping of classes

Reported by: nobody Owned by:
Priority: normal Milestone: _|_
Component: Compiler (Type checker) Version: None
Keywords: Cc: merehap@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Difficulty: Unknown
Test Case: N/A Blocked By:
Blocking: Related Tickets:

Description (last modified by igloo) (diff)

see  Supertyping Suggestion for Haskell

example:

class Num a <= Group a where
	(+) :: a -> a -> a 
	negate :: a -> a

apart from multiple inheritance, it could work like this:

import Prelude hiding ((+),negate)
import qualified Prelude ((+),negate)

class Group a where
	(+) :: a -> a -> a 
	negate :: a -> a

instance Num a => Group a where
	(+) = (Prelude.+)
	negate = Prelude.negate

- coeus_at_gmx_de

Change History

Changed 7 years ago by igloo

  • description modified (diff)
  • component changed from None to Compiler (Type checker)
  • testcase set to N/A
  • difficulty set to Unknown
  • architecture set to Unknown
  • milestone set to _|_
  • os set to Unknown

Changed 5 years ago by simonmar

  • architecture changed from Unknown to Unknown/Multiple

Changed 5 years ago by simonmar

  • os changed from Unknown to Unknown/Multiple

Changed 4 years ago by igloo

  • owner nobody deleted
  • status changed from assigned to new

Changed 11 months ago by merehap

  • cc merehap@… added
  • failure set to None/Unknown
Note: See TracTickets for help on using tickets.