[GHC] #12708: RFC: Representation polymorphic Num
GHC
ghc-devs at haskell.org
Sat Oct 15 04:27:42 UTC 2016
#12708: RFC: Representation polymorphic Num
-------------------------------------+-------------------------------------
Reporter: Iceland_jack | Owner:
Type: feature request | Status: new
Priority: normal | Milestone:
Component: Core Libraries | Version: 8.0.1
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Iceland_jack):
With the upcoming `UnboxedSums`
{{{#!hs
instance (Eq a, Eq b) => Eq (# a | b #) where
(==) :: (# a | b #) -> (# a | b #) -> Bool
(# a | #) == (# a' | #) = a == a'
(# | b #) == (# | b' #) = b == b'
_ == _ = False
}}}
In GHCi, version 8.1.20160930 it seems like you cannot partially apply
unboxed sums `(# | #)` so I can't write
{{{#!hs
instance Functor ((# | #) a)
instance Applicative ((# | #) a)
instance Foldable ((# | #) a)
...
}}}
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12708#comment:9>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list