Use data instead of newtype

This commit is contained in:
Yann Esposito 2012-06-18 10:38:57 +02:00
parent 8194d0e384
commit 66e7ac11ad

View file

@ -5,7 +5,7 @@
> import Graphics.Rendering.OpenGL
> import Graphics.UI.GLUT
> import Data.IORef
> newtype Complex = C (Float,Float) deriving (Show,Eq)
> data Complex = C (Float,Float) deriving (Show,Eq)
> instance Num Complex where
> fromInteger n = C (fromIntegral n,0.0)
> C (x,y) * C (z,t) = C (z*x - y*t, y*z + x*t)