@@ -1,7 +1,7 @@
11
22module Basics where
33
4−import Native.Basics as Native
4+import Native.Basics
55
66type String = [Char]
77
@@ -11,72 +11,72 @@ radians t = t
1111
1212-- Convert degrees to standard Elm angles (radians).
1313degrees : Float -> Float
14−degrees d = d * Native.pi / 180
14+degrees d = d * Native.Basics.pi / 180
1515
1616-- Convert turns to standard Elm angles (radians).
1717-- One turn is equal to 360°.
1818turns : Float -> Float
19−turns r = 2 * Native.pi * r
19+turns r = 2 * Native.Basics.pi * r
2020
2121-- Start with polar coordinates (r,θ)
2222-- and get out cartesian coordinates (x,y).
2323fromPolar : (Float,Float) -> (Float,Float)
24−fromPolar (r,t) = (r * Native.cos t, r * Native.sin t)
24+fromPolar (r,t) = (r * Native.Basics.cos t, r * Native.Basics.sin t)
2525
2626-- Start with cartesian coordinates (x,y)
2727-- and get out polar coordinates (r,θ).
2828toPolar : (Float,Float) -> (Float,Float)
29−toPolar (x,y) = (Native.sqrt (x^2 + y^2), Native.atan2 y x)
29+toPolar (x,y) = (Native.Basics.sqrt (x^2 + y^2), Native.Basics.atan2 y x)
3030
3131(+) : number -> number -> number
32−(+) = Native.add
32+(+) = Native.Basics.add
3333
3434(-) : number -> number -> number
35−(-) = Native.sub
35+(-) = Native.Basics.sub
3636
3737(*) : number -> number -> number
38−(*) = Native.mul
38+(*) = Native.Basics.mul
3939
4040-- Floating point division.
4141(/) : Float -> Float -> Float
42−(/) = Native.floatDiv
42+(/) = Native.Basics.floatDiv
4343
4444-- Integer division, remainder is discarded.
4545div : Int -> Int -> Int
46−div = Native.div
46+div = Native.Basics.div
4747
4848-- Finds the remainder after dividing one number by another: ``4 `rem` 3 == 1``
4949rem : Int -> Int -> Int
50−rem = Native.rem
50+rem = Native.Basics.rem
5151
5252-- Perform modular arithmetic: ``7 `mod` 2 == 1``
5353mod : Int -> Int -> Int
54−mod = Native.mod
54+mod = Native.Basics.mod
5555
5656-- Exponentiation: `3^2 == 9`
5757(^) : number -> number -> number
58−(^) = Native.exp
58+(^) = Native.Basics.exp
5959
6060cos : Float -> Float
61−cos = Native.cos
61+cos = Native.Basics.cos
6262
6363sin : Float -> Float
64−sin = Native.sin
64+sin = Native.Basics.sin
6565
6666tan : Float -> Float
67−tan = Native.tan
67+tan = Native.Basics.tan
6868
6969acos : Float -> Float
70−acos = Native.acos
70+acos = Native.Basics.acos
7171
7272asin : Float -> Float
73−asin = Native.asin
73+asin = Native.Basics.asin
7474
7575-- You probably do not want to use this. Because it takes `(y/x)` as the argument
7676-- there is no way to know where the negative signs come from so the resulting
7777-- angle is always between π/2 and -π/2 (in quadrants I and IV).
7878atan : Float -> Float
79−atan = Native.atan
79+atan = Native.Basics.atan
8080
8181-- This helps you find the angle of a cartesian coordinate.
8282-- You will almost certainly want to use this instead of `atan`.
@@ -84,27 +84,27 @@ atan = Native.atan
8484-- quadrant the angle should really be in. The result will be between
8585-- π and -π, giving you the full range of angles.
8686atan2 : Float -> Float -> Float
87−atan2 = Native.atan2
87+atan2 = Native.Basics.atan2
8888
8989-- Take the square root of a number.
9090sqrt : number -> number
91−sqrt = Native.sqrt
91+sqrt = Native.Basics.sqrt
9292
9393-- Take the absolute value of a number.
9494abs : number -> number
95−abs = Native.abs
95+abs = Native.Basics.abs
9696
9797-- Calculate the logarithm of a number with a given base: `logBase 10 100 == 2`
9898logBase : number -> number -> number
99−logBase = Native.logBase
99+logBase = Native.Basics.logBase
100100
101101-- Given two comparables, returns the smaller one.
102102min : comparable -> comparable -> comparable
103−min = Native.min
103+min = Native.Basics.min
104104
105105-- Given two comparables, returns the larger one.
106106max : comparable -> comparable -> comparable
107−max = Native.max
107+max = Native.Basics.max
108108
109109-- Clamps a number within a given range. With the expression `clamp 100 200 x`
110110-- the results are as follows:
@@ -113,40 +113,40 @@ max = Native.max
113113-- * ` x if 100 <= x < 200`
114114-- * `200 if 200 <= x`
115115clamp : number -> number -> number -> number
116−clamp = Native.clamp
116+clamp = Native.Basics.clamp
117117
118118-- An approximation of pi.
119119pi : Float
120−pi = Native.pi
120+pi = Native.Basics.pi
121121
122122-- An approximation of e.
123123e : Float
124−e = Native.e
124+e = Native.Basics.e
125125
126126-- Compare any two values for structural equality. Functions cannot be compared.
127127(==) : a -> a -> Bool
128−(==) = Native.eq
128+(==) = Native.Basics.eq
129129
130130(/=) : a -> a -> Bool
131−(/=) = Native.neq
131+(/=) = Native.Basics.neq
132132
133133(<) : comparable -> comparable -> Bool
134−(<) = Native.lt
134+(<) = Native.Basics.lt
135135
136136(>) : comparable -> comparable -> Bool
137−(>) = Native.gt
137+(>) = Native.Basics.gt
138138
139139(<=) : comparable -> comparable -> Bool
140−(<=) = Native.le
140+(<=) = Native.Basics.le
141141
142142(>=) : comparable -> comparable -> Bool
143−(>=) = Native.ge
143+(>=) = Native.Basics.ge
144144
145145-- Compare any two comparable values. Comparable values include `String`, `Char`,
146146-- `Int`, `Float`, `Time`, or a list or tuple containing comparable values.
147147-- These are also the only values that work as `Dict` keys or `Set` members.
148148compare : comparable -> comparable -> Order
149−compare = Native.compare
149+compare = Native.Basics.compare
150150
151151-- Represents the relative ordering of two things.
152152-- The relations are less than, equal to, and greater than.
@@ -154,19 +154,19 @@ data Order = LT | EQ | GT
154154
155155-- The and operator. True if both inputs are True.
156156(&&) : Bool -> Bool -> Bool
157−(&&) = Native.and
157+(&&) = Native.Basics.and
158158
159159-- The or operator. True if one or both inputs are True.
160160(||) : Bool -> Bool -> Bool
161−(||) = Native.or
161+(||) = Native.Basics.or
162162
163163-- The exclusive-or operator. True if exactly one input is True.
164164xor : Bool -> Bool -> Bool
165−xor = Native.xor
165+xor = Native.Basics.xor
166166
167167-- Negate a boolean value: `(not True == False)` and `(not False == True)`
168168not : Bool -> Bool
169−not = Native.not
169+not = Native.Basics.not
170170
171171-- Equal to true. Useful as the last case of a multi-way-if.
172172otherwise : Bool
@@ -177,35 +177,35 @@ otherwise = True
177177
178178-- Round a number to the nearest integer.
179179round : Float -> Int
180−round = Native.round
180+round = Native.Basics.round
181181
182182-- Truncate a decimal number, rounding towards zero.
183183truncate : Float -> Int
184−truncate = Native.truncate
184+truncate = Native.Basics.truncate
185185
186186-- Floor function, rounding down.
187187floor : Float -> Int
188−floor = Native.floor
188+floor = Native.Basics.floor
189189
190190-- Ceiling function, rounding up.
191191ceiling : Float -> Int
192−ceiling = Native.ceiling
192+ceiling = Native.Basics.ceiling
193193
194194-- Convert an integer into a float.
195195toFloat : Int -> Float
196−toFloat = Native.toFloat
196+toFloat = Native.Basics.toFloat
197197
198198-- Convert almost any value to its string representation.
199199show : a -> String
200−show = Native.show
200+show = Native.Basics.show
201201
202202-- Read an integer from a string
203203-- readInt : String -> Maybe Int
204−readInt = Native.readInt
204+--readInt = Native.Basics.readInt
205205
206206-- Read a float from a string.
207207-- readFloat : String -> Maybe Float
208−readFloat = Native.readFloat
208+--readFloat = Native.Basics.readFloat
209209
210210-- Function Helpers
211211
@@ -244,11 +244,11 @@ id x = x
244244
245245-- Given a 2-tuple, returns the first value.
246246fst : (a,b) -> a
247−fst = Native.fst
247+fst = Native.Basics.fst
248248
249249-- Given a 2-tuple, returns the second value.
250250snd : (a,b) -> b
251−snd = Native.snd
251+snd = Native.Basics.snd
252252
253253-- Flips the order of the first two arguments to a function.
254254flip : (a -> b -> c) -> (b -> a -> c)
@@ -257,9 +257,9 @@ flip f b a = f a b
257257-- Change how arguments are passed to a function. This splits paired arguments
258258-- into two separate arguments.
259259curry : ((a,b) -> c) -> a -> b -> c
260−curry = Native.curry
260+curry = Native.Basics.curry
261261
262262-- Change how arguments are passed to a function. This combines two arguments
263263-- into a sigle pair.
264264uncurry : (a -> b -> c) -> (a,b) -> c
265−uncurry = Native.uncurry
265+uncurry = Native.Basics.uncurry