Commit 3541f736 authored by Ben Gamari's avatar Ben Gamari 🐢 Committed by Austin Seipp
Browse files

Data.Complex: Derive Generic

Reviewed By: hvr, austin

Differential Revision: https://phabricator.haskell.org/D770
parent 012ea0b9
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE DeriveGeneric #-}
-----------------------------------------------------------------------------
-- |
......@@ -34,6 +35,7 @@ module Data.Complex
) where
import GHC.Generics (Generic)
import Data.Data (Data)
import Foreign (Storable, castPtr, peek, poke, pokeElemOff, peekElemOff, sizeOf,
alignment)
......@@ -51,7 +53,7 @@ infix 6 :+
data Complex a
= !a :+ !a -- ^ forms a complex number from its real and imaginary
-- rectangular components.
deriving (Eq, Show, Read, Data)
deriving (Eq, Show, Read, Data, Generic)
-- -----------------------------------------------------------------------------
-- Functions over Complex
......
......@@ -29,6 +29,7 @@
* New `GHC.Stack.CallStack` data type
* `Complex` now has a `Generic` instance
## 4.8.0.0 *Mar 2015*
......
......@@ -3,7 +3,6 @@
module T5884 where
import GHC.Generics
import T5884Other
import Data.Complex
deriving instance Generic (Complex v)
deriving instance Generic (Pair a)
module T5884Other where
data Pair a = Pair a a
......@@ -26,7 +26,8 @@ test('T5462Yes2', extra_clean(['T5462Yes2/GFunctor.hi'])
test('T5462No1', extra_clean(['T5462No1/GFunctor.hi'])
, multimod_compile_fail, ['T5462No1', '-iGFunctor -outputdir=T5462No1'])
test('T5884', normal, compile, [''])
test('T5884', extra_clean(['T5884Other.o', 'T5884Other.hi'])
, multimod_compile, ['T5884Other', '-v0'])
test('GenNewtype', normal, compile_and_run, [''])
test('GenDerivOutput1_0', normal, compile, ['-dsuppress-uniques'])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment