blob: 5c56e829924c9d23e1ace52bb6305baaebfaf682 (
plain)
1
2
3
4
5
6
7
8
9
10
|
{-# OPTIONS_GHC -fno-warn-missing-methods -fno-warn-deprecations #-}
module C where
data Complex a = !a :+ !a
deriving (Eq, Show)
instance (RealFloat a) => Num (Complex a) where
{-# SPECIALISE instance Num (Complex Float) #-}
{-# SPECIALISE instance Num (Complex Double) #-}
(x :+ y) + (x' :+ y') = (x + x') :+ (y + y')
|