Opened 11 years ago

Last modified 5 years ago

#472 new feature request (None)

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 Test Case: N/A
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description (last modified by igloo)

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 (5)

comment:1 Changed 10 years ago by igloo

Architecture: Unknown
Component: NoneCompiler (Type checker)
Description: modified (diff)
difficulty: Unknown
Milestone: _|_
Operating System: Unknown
Test Case: N/A

comment:2 Changed 8 years ago by simonmar

Architecture: UnknownUnknown/Multiple

comment:3 Changed 8 years ago by simonmar

Operating System: UnknownUnknown/Multiple

comment:4 Changed 8 years ago by igloo

Owner: nobody deleted
Status: assignednew

comment:5 Changed 5 years ago by merehap

Cc: merehap@… added
Type of failure: None/Unknown
Note: See TracTickets for help on using tickets.