on master help sign in
Move Data.Floats to Prelude.Doubles

It seems odd not to have these available by default

commitfe4d6d3e771f02124477e00a9cd06866a1be6a73 authorEdwin Brady <ecb10@st-andrews.ac.uk> dateThu 3 Sep 2015, 19:53 (11 years ago) parentf7ccfb3
8 files changed+26−25
libs/base/Data/Complex.idr−2 libs/base/base.ipkg+1−1 libs/prelude/Prelude.idr+1 libs/base/Data/Floats.idr → libs/prelude/Prelude/Doubles.idr+22−18 libs/prelude/prelude.ipkg+1−1 test/primitives001/expected−1 test/primitives001/test005.idr−1 test/proofsearch002/Process.idr+1−1
libs/base/Data/Complex.idr−2
@@ -5,8 +5,6 @@
55
66module Data.Complex
77
8−import Data.Floats
9−
108------------------------------ Rectangular form
119
1210infix 6 :+
libs/base/base.ipkg+1−1
@@ -15,7 +15,7 @@ modules = System,
1515 Data.Bits, Data.Mod2,
1616 Data.Fin, Data.Vect, Data.VectType,
1717 Data.HVect, Data.Vect.Quantifiers,
18− Data.Floats, Data.Complex,
18+ Data.Complex,
1919 Data.Erased, Data.List,
2020 Data.So,
2121
libs/prelude/Prelude.idr+1
@@ -27,6 +27,7 @@ import public Prelude.Providers
2727import public Prelude.Show
2828import public Prelude.Interactive
2929import public Prelude.File
30+import public Prelude.Doubles
3031import public Decidable.Equality
3132import public Language.Reflection
3233import public Language.Reflection.Errors
libs/base/Data/Floats.idr → libs/prelude/Prelude/Doubles.idrrenamed+22−18
@@ -1,4 +1,7 @@
1−module Data.Floats
1+module Prelude.Doubles
2+
3+import Builtins
4+import Prelude.Classes
25
36%access public
47%default total
@@ -6,54 +9,55 @@ module Data.Floats
69%include C "math.h"
710%lib C "m"
811
9−pi : Float
12+pi : Double
1013pi = 3.14159265358979323846
1114
12−euler : Float
15+euler : Double
1316euler = 2.7182818284590452354
1417
15−exp : Float -> Float
18+exp : Double -> Double
1619exp x = prim__floatExp x
1720
18−log : Float -> Float
21+log : Double -> Double
1922log x = prim__floatLog x
2023
21−sin : Float -> Float
24+sin : Double -> Double
2225sin x = prim__floatSin x
2326
24−cos : Float -> Float
27+cos : Double -> Double
2528cos x = prim__floatCos x
2629
27−tan : Float -> Float
30+tan : Double -> Double
2831tan x = prim__floatTan x
2932
30−asin : Float -> Float
33+asin : Double -> Double
3134asin x = prim__floatASin x
3235
33−acos : Float -> Float
36+acos : Double -> Double
3437acos x = prim__floatACos x
3538
36−atan : Float -> Float
39+atan : Double -> Double
3740atan x = prim__floatATan x
3841
39−atan2 : Float -> Float -> Float
42+atan2 : Double -> Double -> Double
4043atan2 y x = atan (y/x)
4144
42−sinh : Float -> Float
45+sinh : Double -> Double
4346sinh x = (exp x - exp (-x)) / 2
4447
45−cosh : Float -> Float
48+cosh : Double -> Double
4649cosh x = (exp x + exp (-x)) / 2
4750
48−tanh : Float -> Float
51+tanh : Double -> Double
4952tanh x = sinh x / cosh x
5053
51−sqrt : Float -> Float
54+sqrt : Double -> Double
5255sqrt x = prim__floatSqrt x
5356
54−floor : Float -> Float
57+floor : Double -> Double
5558floor x = prim__floatFloor x
5659
57−ceiling : Float -> Float
60+ceiling : Double -> Double
5861ceiling x = prim__floatCeil x
5962
63+
libs/prelude/prelude.ipkg+1−1
@@ -9,7 +9,7 @@ modules = Builtins, Prelude, IO,
99 Prelude.Strings, Prelude.Chars, Prelude.Show, Prelude.Functor,
1010 Prelude.Foldable, Prelude.Traversable, Prelude.Bits, Prelude.Stream,
1111 Prelude.Uninhabited, Prelude.Pairs, Prelude.Providers,
12− Prelude.Interactive, Prelude.File,
12+ Prelude.Interactive, Prelude.File, Prelude.Doubles,
1313
1414 Language.Reflection, Language.Reflection.Errors, Language.Reflection.Elab,
1515
test/primitives001/expected−1
@@ -1,5 +1,4 @@
118
2−1
32("abc", "123")
43("abc", "123")
54([1, 2], [3, 4, 5])
test/primitives001/test005.idr−1
@@ -8,7 +8,6 @@ tlist = [1, 2, 3, 4, 5]
88
99main : IO ()
1010main = do printLn (abs (-8))
11− printLn (abs (S Z))
1211 printLn (span isAlpha tstr)
1312 printLn (break isDigit tstr)
1413 printLn (span (\x => x < 3) tlist)
test/proofsearch002/Process.idr+1−1
@@ -339,7 +339,7 @@ removeConn cl acc [] = (cl, reverse acc)
339339removeConn cl acc ((pid, ConnectMsg) :: xs)
340340 = removeConn (cl + 1) acc xs
341341removeConn cl acc ((pid, CloseMsg) :: xs)
342− = removeConn (cl - 1) acc xs
342+ = removeConn (minus cl 1) acc xs
343343removeConn cl acc (x :: xs) = removeConn cl (x :: acc) xs
344344
345345-- Remove the first thing in the event list which is a request, if it