[ ghc-Feature Requests-1333482 ] Supertyping of classes

SourceForge.net noreply at sourceforge.net
Thu Oct 20 14:34:34 EDT 2005


Feature Requests item #1333482, was opened at 2005-10-20 11:34
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=358032&aid=1333482&group_id=8032

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: Supertyping of classes

Initial Comment:
see "Supertyping Suggestion for Haskell"
[url]http://repetae.net/john/recent/out/supertyping.html[/url]

example:
[code]
class Num a <= Group a where
	(+) :: a -> a -> a 
	negate :: a -> a
[/code]

apart from multiple inheritance, it could work like this:

[code]
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
[/code]

- coeus_at_gmx_de


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=358032&aid=1333482&group_id=8032


More information about the Glasgow-haskell-users mailing list