[GHC] #7633: Checkable "minimal complete definitions"
GHC
ghc-devs at haskell.org
Wed Jun 5 04:17:39 CEST 2013
#7633: Checkable "minimal complete definitions"
---------------------------------+------------------------------------------
Reporter: shachaf | Owner:
Type: feature request | Status: patch
Priority: normal | Milestone: 7.8.1
Component: Compiler | Version: 7.6.1
Keywords: | Os: Unknown/Multiple
Architecture: Unknown/Multiple | Failure: None/Unknown
Difficulty: Unknown | Testcase:
Blockedby: | Blocking:
Related: 6028 |
---------------------------------+------------------------------------------
Comment(by dmwit):
This might be a bit of feature creep, but I thought I would try to archive
a bit of #haskell discussion: it might be worth thinking about how to do
cross-class MINIMAL pragmas. For example, imagine a world where we had
something like this:
{{{
{-# LANGUAGE DefaultSignatures #-}
class Functor f where
fmap :: (a -> b) -> (f a -> f b)
default fmap :: Traversable f => (a -> b) -> (f a -> f b)
fmap = getId . traverse (Id . f)
class Functor f => Traversable f where
traverse :: Applicative f => (a -> f b) -> t a -> f (t b)
traverse f = sequenceA . fmap f
sequenceA :: Applicative f => t (f a) -> f (t a)
sequenceA = traverse id
}}}
I might like to be able to say that either "fmap and sequenceA" or
"traverse" are okay minimal definitions for the two classes together.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7633#comment:20>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list