|
Re: [GHC] #472: Supertyping of classes: msg#00188lang.haskell.glasgow.bugs
#472: Supertyping of classes -------------------------------------+-------------------------------------- Reporter: nobody | Owner: nobody Type: feature request | Status: assigned Priority: normal | Milestone: _|_ Component: Compiler (Type checker) | Version: None Severity: minor | Resolution: None Keywords: | Difficulty: Unknown Testcase: N/A | Architecture: Unknown Os: Unknown | -------------------------------------+-------------------------------------- Changes (by igloo): * architecture: => Unknown * difficulty: => Unknown * component: None => Compiler (Type checker) * milestone: => _|_ * testcase: => N/A * os: => Unknown Old description: > {{{ > 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 > > }}} New description: see [http://repetae.net/john/recent/out/supertyping.html 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 -- Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/472> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler_______________________________________________ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@xxxxxxxxxxx http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: [GHC] #462: Incomplete pattern warnings with GADTs, GHC |
|---|---|
| Next by Date: | Re: [GHC] #477: Compiling multiple executables with -make, GHC |
| Previous by Thread: | Re: [GHC] #462: Incomplete pattern warnings with GADTs, GHC |
| Next by Thread: | Re: [GHC] #477: Compiling multiple executables with -make, GHC |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |