on master help sign in
Change library and expected test results for Float -> Double change
8a17e9aEcho Nolan
libs/base/Data/Complex.idr+7−7
@@ -40,16 +40,16 @@ instance Fractional a => Fractional (Complex a) where
40
40
41------------------------------ Polarform
41------------------------------ Polarform
42
42
43−mkPolar : Float -> Float -> Complex Float
43+mkPolar : Double -> Double -> Complex Double
44mkPolar radius angle = radius * cos angle :+ radius * sin angle
44mkPolar radius angle = radius * cos angle :+ radius * sin angle
45
45
46−cis : Float -> Complex Float
46+cis : Double -> Complex Double
47cis angle = cos angle :+ sin angle
47cis angle = cos angle :+ sin angle
48
48
49−magnitude : Complex Float -> Float
49+magnitude : Complex Double -> Double
50magnitude (r:+i) = sqrt (r*r+i*i)
50magnitude (r:+i) = sqrt (r*r+i*i)
51
51
52−phase : Complex Float -> Float
52+phase : Complex Double -> Double
53phase (x:+y) = atan2 y x
53phase (x:+y) = atan2 y x
54
54
55
55
@@ -62,13 +62,13 @@ instance Functor Complex where
62 map f (r :+ i) = f r :+ f i
62 map f (r :+ i) = f r :+ f i
63
63
64-- We can't do "instance Num a => Num (Complex a)" because
64-- We can't do "instance Num a => Num (Complex a)" because
65−-- we need "abs" which needs "magnitude" which needs "sqrt" which needs Float
65+-- we need "abs" which needs "magnitude" which needs "sqrt" which needs Double
66−instance Num (Complex Float) where
66+instance Num (Complex Double) where
67 (+) (a:+b) (c:+d) = ((a+c):+(b+d))
67 (+) (a:+b) (c:+d) = ((a+c):+(b+d))
68 (*) (a:+b) (c:+d) = ((a*c-b*d):+(b*c+a*d))
68 (*) (a:+b) (c:+d) = ((a*c-b*d):+(b*c+a*d))
69 fromInteger x = (fromInteger x:+0)
69 fromInteger x = (fromInteger x:+0)
70
70
71−instance Neg (Complex Float) where
71+instance Neg (Complex Double) where
72 negate = map negate
72 negate = map negate
73 (-) (a:+b) (c:+d) = ((a-c):+(b-d))
73 (-) (a:+b) (c:+d) = ((a-c):+(b-d))
74 abs (a:+b) = (magnitude (a:+b):+0)
74 abs (a:+b) = (magnitude (a:+b):+0)
libs/contrib/Control/Algebra/NumericInstances.idr+7−7
@@ -44,24 +44,24 @@ instance RingWithUnity Int where
44 unity = 1
44 unity = 1
45
45
46
46
47−instance Semigroup Float where
47+instance Semigroup Double where
48 (<+>) = (+)
48 (<+>) = (+)
49
49
50−instance Monoid Float where
50+instance Monoid Double where
51 neutral = 0
51 neutral = 0
52
52
53−instance Group Float where
53+instance Group Double where
54 inverse = (* -1)
54 inverse = (* -1)
55
55
56−instance AbelianGroup Float
56+instance AbelianGroup Double
57
57
58−instance Ring Float where
58+instance Ring Double where
59 (<.>) = (*)
59 (<.>) = (*)
60
60
61−instance RingWithUnity Float where
61+instance RingWithUnity Double where
62 unity = 1
62 unity = 1
63
63
64−instance Field Float where
64+instance Field Double where
65 inverseM f _ = 1 / f
65 inverseM f _ = 1 / f
66
66
67
67
libs/effects/Effect/Default.idr+1−1
@@ -11,7 +11,7 @@ instance Default Int where
11instance Default Integer where
11instance Default Integer where
12 default = 0
12 default = 0
13
13
14−instance Default Float where
14+instance Default Double where
15 default = 0
15 default = 0
16
16
17instance Default Nat where
17instance Default Nat where
libs/oldeffects/Effect/Default.idr+1−1
@@ -9,7 +9,7 @@ instance Default Int where
9instance Default Integer where
9instance Default Integer where
10 default = 0
10 default = 0
11
11
12−instance Default Float where
12+instance Default Double where
13 default = 0
13 default = 0
14
14
15instance Default Nat where
15instance Default Nat where
libs/prelude/IO.idr+2−2
@@ -162,7 +162,7 @@ namespace FFI_C
162 ||| Supported C foreign types
162 ||| Supported C foreign types
163 data C_Types : Type -> Type where
163 data C_Types : Type -> Type where
164 C_Str : C_Types String
164 C_Str : C_Types String
165− C_Float : C_Types Float
165+ C_Float : C_Types Double
166 C_Ptr : C_Types Ptr
166 C_Ptr : C_Types Ptr
167 C_MPtr : C_Types ManagedPtr
167 C_MPtr : C_Types ManagedPtr
168 C_Unit : C_Types ()
168 C_Unit : C_Types ()
@@ -221,7 +221,7 @@ mutual
221
221
222 data JS_Types : Type -> Type where
222 data JS_Types : Type -> Type where
223 JS_Str : JS_Types String
223 JS_Str : JS_Types String
224− JS_Float : JS_Types Float
224+ JS_Float : JS_Types Double
225 JS_Ptr : JS_Types Ptr
225 JS_Ptr : JS_Types Ptr
226 JS_Unit : JS_Types ()
226 JS_Unit : JS_Types ()
227 JS_FnT : JS_FnTypes a -> JS_Types (JsFn a)
227 JS_FnT : JS_FnTypes a -> JS_Types (JsFn a)
libs/prelude/Prelude/Classes.idr+6−6
@@ -37,7 +37,7 @@ instance Eq Int where
37instance Eq Integer where
37instance Eq Integer where
38 (==) = boolOp prim__eqBigInt
38 (==) = boolOp prim__eqBigInt
39
39
40−instance Eq Float where
40+instance Eq Double where
41 (==) = boolOp prim__eqFloat
41 (==) = boolOp prim__eqFloat
42
42
43instance Eq Char where
43instance Eq Char where
@@ -118,7 +118,7 @@ instance Ord Integer where
118 GT
118 GT
119
119
120
120
121−instance Ord Float where
121+instance Ord Double where
122 compare x y = if (x == y) then EQ else
122 compare x y = if (x == y) then EQ else
123 if (boolOp prim__sltFloat x y) then LT else
123 if (boolOp prim__sltFloat x y) then LT else
124 GT
124 GT
@@ -170,7 +170,7 @@ instance Num Int where
170 fromInteger = prim__truncBigInt_Int
170 fromInteger = prim__truncBigInt_Int
171
171
172
172
173−instance Num Float where
173+instance Num Double where
174 (+) = prim__addFloat
174 (+) = prim__addFloat
175 (*) = prim__mulFloat
175 (*) = prim__mulFloat
176
176
@@ -215,7 +215,7 @@ instance Neg Int where
215 (-) = prim__subInt
215 (-) = prim__subInt
216 abs x = if x < (prim__truncBigInt_Int 0) then -x else x
216 abs x = if x < (prim__truncBigInt_Int 0) then -x else x
217
217
218−instance Neg Float where
218+instance Neg Double where
219 negate x = prim__negFloat x
219 negate x = prim__negFloat x
220 (-) = prim__subFloat
220 (-) = prim__subFloat
221 abs x = if x < (prim__toFloatBigInt 0) then -x else x
221 abs x = if x < (prim__toFloatBigInt 0) then -x else x
@@ -306,8 +306,8 @@ instance MaxBound Bits64 where
306
306
307-- ------------------------------------------------------------- [ Fractionals ]
307-- ------------------------------------------------------------- [ Fractionals ]
308
308
309−||| Fractional division of two Floats.
309+||| Fractional division of two Doubles.
310−(/) : Float -> Float -> Float
310+(/) : Double -> Double -> Double
311(/) = prim__divFloat
311(/) = prim__divFloat
312
312
313
313
test/ffi001/test022.idr+2−2
@@ -2,8 +2,8 @@ module Main
2
2
3%dynamic "dummy", "libm", "msvcrt"
3%dynamic "dummy", "libm", "msvcrt"
4
4
5−x : Float
5+x : Double
6−x = unsafePerformIO (foreign FFI_C "sin" (Float -> IO Float) 1.6)
6+x = unsafePerformIO (foreign FFI_C "sin" (Double -> IO Double) 1.6)
7
7
8main : IO ()
8main : IO ()
9main = putStrLn (show x)
9main = putStrLn (show x)
test/interactive010/expected+3−3
@@ -1,14 +1,14 @@
1Prelude.List.(++) : List a -> List a -> List a
1Prelude.List.(++) : List a -> List a -> List a
2Prelude.Strings.(++) : String -> String -> String
2Prelude.Strings.(++) : String -> String -> String
3−Prelude.Classes./ : (__pi_arg : Float) →
3+Prelude.Classes./ : (__pi_arg : Double) →
4− (__pi_arg1 : Float) → Float
4+ (__pi_arg1 : Double) → Double
5Usage is :doc <functionname>
5Usage is :doc <functionname>
6Usage is :wc <functionname>
6Usage is :wc <functionname>
7Usage is :printdef <functionname>
7Usage is :printdef <functionname>
8prim__divFloat
8prim__divFloat
9Prelude.Classes./
9Prelude.Classes./
10
10
11− : Float -> Float -> Float
11+ : Double -> Double -> Double
12(input):1:1: error: expected: ":",
12(input):1:1: error: expected: ":",
13 dependent type signature,
13 dependent type signature,
14 end of input
14 end of input