on master help sign in
Make docs more consistent
commitb84308ebdc1413801d07b39ebeb9b8aff48f9c6b authorMax Goldstein <maxgoldstein1@gmail.com> dateWed 8 Oct 2014, 20:19 (12 years ago) parentcf12033
6 files changed+166−105
libraries/Basics.elm+40−28 libraries/Date.elm+1−1 libraries/List.elm+80−30 libraries/String.elm+12−12 libraries/Text.elm+21−24 libraries/Transform2D.elm+12−10
libraries/Basics.elm+40−28
@@ -66,15 +66,11 @@ One turn is equal to 360&deg;.
6666turns : Float -> Float
6767turns = Native.Basics.turns
6868
69−{-| Start with polar coordinates (r,&theta;)
70−and get out cartesian coordinates (x,y).
71−-}
69+{-| Convert polar coordinates (r,&theta;) to cartesian coordinates (x,y). -}
7270fromPolar : (Float,Float) -> (Float,Float)
7371fromPolar = Native.Basics.fromPolar
7472
75−{-| Start with cartesian coordinates (x,y)
76−and get out polar coordinates (r,&theta;).
77−-}
73+{-| Convert cartesian coordinates (x,y) to polar coordinates (r,&theta;). -}
7874toPolar : (Float,Float) -> (Float,Float)
7975toPolar = Native.Basics.toPolar
8076
@@ -101,11 +97,11 @@ infixl 7 //
10197infixl 7 %
10298infixl 7 `rem`
10399
104−{-| Integer division, remainder is discarded. -}
100+{-| Integer division. The remainder is discarded. -}
105101(//) : Int -> Int -> Int
106102(//) = Native.Basics.div
107103
108−{-| Finds the remainder after dividing one number by another:
104+{-| Find the remainder after dividing one number by another.
109105
110106 7 `rem` 2 == 1
111107 -1 `rem` 4 == -1
@@ -113,7 +109,7 @@ infixl 7 `rem`
113109rem : Int -> Int -> Int
114110rem = Native.Basics.rem
115111
116−{-| Perform [modular arithmetic](http://en.wikipedia.org/wiki/Modular_arithmetic):
112+{-| Perform [modular arithmetic](http://en.wikipedia.org/wiki/Modular_arithmetic).
117113
118114 7 % 2 == 1
119115 -1 % 4 == 3
@@ -121,7 +117,10 @@ rem = Native.Basics.rem
121117(%) : Int -> Int -> Int
122118(%) = Native.Basics.mod
123119
124−{-| Exponentiation: `3^2 == 9` -}
120+{-| Exponentiation
121+
122+ 3^2 == 9`
123+-}
125124(^) : number -> number -> number
126125(^) = Native.Basics.exp
127126
@@ -161,7 +160,12 @@ atan2 = Native.Basics.atan2
161160sqrt : Float -> Float
162161sqrt = Native.Basics.sqrt
163162
164−{-| Negate any number: `negate 42 == -42` -}
163+{-| Negate a number.
164+
165+ negate 42 == -42
166+ negate -42 == 42
167+ negate 0 == 0
168+-}
165169negate : number -> number
166170negate = Native.Basics.negate
167171
@@ -169,7 +173,11 @@ negate = Native.Basics.negate
169173abs : number -> number
170174abs = Native.Basics.abs
171175
172−{-| Calculate the logarithm of a number with a given base: `logBase 10 100 == 2` -}
176+{-| Calculate the logarithm of a number with a given base.
177+
178+ logBase 10 100 == 2
179+ logBase 2 256 == 8
180+-}
173181logBase : Float -> Float -> Float
174182logBase = Native.Basics.logBase
175183
@@ -228,22 +236,22 @@ The relations are less than, equal to, and greater than.
228236-}
229237data Order = LT | EQ | GT
230238
231−{-| Given two comparables, returns the smaller one. -}
239+{-| Find the smaller of two comparables. -}
232240min : comparable -> comparable -> comparable
233241min = Native.Basics.min
234242
235−{-| Given two comparables, returns the larger one. -}
243+{-| Find the larger of two comparables. -}
236244max : comparable -> comparable -> comparable
237245max = Native.Basics.max
238246
239−{-| The and operator. True if both inputs are True.
240−This operator short-circuits if the first argument is False.
247+{-| The logical AND operator. `True` if both inputs are `True`.
248+This operator short-circuits to `False` if the first argument is `False`.
241249-}
242250(&&) : Bool -> Bool -> Bool
243251(&&) = Native.Basics.and
244252
245−{-| The or operator. True if one or both inputs are True.
246−This operator short-circuits if the first argument is True.
253+{-| The logical OR operator. `True` if one or both inputs are `True`.
254+This operator short-circuits to `True` if the first argument is True.
247255-}
248256(||) : Bool -> Bool -> Bool
249257(||) = Native.Basics.or
@@ -251,15 +259,19 @@ This operator short-circuits if the first argument is True.
251259infixr 3 &&
252260infixr 2 ||
253261
254−{-| The exclusive-or operator. True if exactly one input is True. -}
262+{-| The exclusive-or operator. `True` if exactly one input is `True`. -}
255263xor : Bool -> Bool -> Bool
256264xor = Native.Basics.xor
257265
258−{-| Negate a boolean value: `(not True == False)` and `(not False == True)` -}
266+{-| Negate a boolean value.
267+
268+ not True == False
269+ not False == True
270+-}
259271not : Bool -> Bool
260272not = Native.Basics.not
261273
262−{-| Equal to true. Useful as the last case of a multi-way-if. -}
274+{-| Equal to `True`. Useful as the last case of a multi-way-if. -}
263275otherwise : Bool
264276otherwise = True
265277
@@ -270,7 +282,7 @@ otherwise = True
270282round : Float -> Int
271283round = Native.Basics.round
272284
273−{-| Truncate a decimal number, rounding towards zero. -}
285+{-| Truncate a number, rounding towards zero. -}
274286truncate : Float -> Int
275287truncate = Native.Basics.truncate
276288
@@ -286,7 +298,7 @@ ceiling = Native.Basics.ceiling
286298toFloat : Int -> Float
287299toFloat = Native.Basics.toFloat
288300
289−{- | Determines whether a float is an undefined or unrepresentable number.
301+{- | Determine whether a float is an undefined or unrepresentable number.
290302NaN stands for *not a number* and it is [a standardized part of floating point
291303numbers](http://en.wikipedia.org/wiki/NaN).
292304
@@ -298,7 +310,7 @@ numbers](http://en.wikipedia.org/wiki/NaN).
298310isNaN : Float -> Bool
299311isNaN = Native.Basics.isNaN
300312
301−{- | Determines whether a float is positive or negative infinity.
313+{- | Determine whether a float is positive or negative infinity.
302314
303315 isInfinite (0/0) == False
304316 isInfinite (sqrt -1) == False
@@ -355,8 +367,8 @@ This can also be written as:
355367(|>) : a -> (a -> b) -> b
356368x |> f = f x
357369
358−{-| Function application `f <| x == f x`. This function is useful for avoiding
359−parenthesis. Consider the following code to create a text element:
370+{-| Backward function application `f <| x == f x`. This function is useful for
371+avoiding parenthesis. Consider the following code to create a text element:
360372
361373 text (monospace (toText "code"))
362374
@@ -378,7 +390,7 @@ infixl 0 |>
378390identity : a -> a
379391identity x = x
380392
381−{-| Creates a [constant function](http://en.wikipedia.org/wiki/Constant_function),
393+{-| Create a [constant function](http://en.wikipedia.org/wiki/Constant_function),
382394a function that *always* returns the same value regardless of what input you give.
383395It is defined as:
384396
@@ -402,7 +414,7 @@ fst (a,_) = a
402414snd : (a,b) -> b
403415snd (_,b) = b
404416
405−{-| Flips the order of the first two arguments to a function. -}
417+{-| Flip the order of the first two arguments to a function. -}
406418flip : (a -> b -> c) -> (b -> a -> c)
407419flip f b a = f a b
408420
libraries/Date.elm+1−1
@@ -36,7 +36,7 @@ read = Native.Date.read
3636toTime : Date -> Time
3737toTime = Native.Date.toTime
3838
39−{-| Take a UNIX time and convert it to a `Date` -}
39+{-| Take a UNIX time and convert it to a `Date`. -}
4040fromTime : Time -> Date
4141fromTime = Native.Date.fromTime
4242
libraries/List.elm+80−30
@@ -41,11 +41,15 @@ import Basics (..)
4141import Maybe ( Maybe(Just,Nothing) )
4242import Native.List
4343
44−{-| Add an element to the front of a list `(1 :: [2,3] == [1,2,3])` -}
44+{-| Add an element to the front of a list. Pronounced *cons*.
45+
46+ 1 :: [2,3] == [1,2,3]
47+ 1 :: [] == [1]
48+-}
4549(::) : a -> [a] -> [a]
4650(::) = Native.List.cons
4751
48−{-| Puts two appendable things together:
52+{-| Put two appendable things together.
4953
5054 [1,1] ++ [2,3] == [1,1,2,3]
5155 "abc" ++ "123" == "abc123"
@@ -57,31 +61,40 @@ infixr 5 ::
5761infixr 5 ++
5862
5963{-| Extract the first element of a list. List must be non-empty.
60−`(head [1,2,3] == 1)`
64+
65+ head [1,2,3] == 1
6166-}
6267head : [a] -> a
6368head = Native.List.head
6469
6570{-| Extract the elements after the head of the list. List must be non-empty.
66−`(tail [1,2,3] == [2,3])`
71+
72+ tail [1,2,3] == [2,3]
6773-}
6874tail : [a] -> [a]
6975tail = Native.List.tail
7076
7177{-| Extract the last element of a list. List must be non-empty.
72−`(last [1,2,3] == 3)`
78+
79+ last [1,2,3] == 3
7380-}
7481last : [a] -> a
7582last = Native.List.last
7683
77−{-| Check if a list is empty `(isEmpty [] == True)` -}
84+{-| Determine if a list is empty.
85+
86+ isEmpty [] == True
87+-}
7888isEmpty : [a] -> Bool
7989isEmpty xs =
8090 case xs of
8191 [] -> True
8292 _ -> False
8393
84−{-| Apply a function to every element of a list: `(map sqrt [1,4,9] == [1,2,3])` -}
94+{-| Apply a function to every element of a list.
95+
96+ map sqrt [1,4,9] == [1,2,3]
97+-}
8598map : (a -> b) -> [a] -> [b]
8699map = Native.List.map
87100
@@ -94,11 +107,17 @@ indexedMap : (Int -> a -> b) -> [a] -> [b]
94107indexedMap f xs =
95108 zipWith f [ 0 .. length xs - 1 ] xs
96109
97−{-| Reduce a list from the left: `(foldl (::) [] [1,2,3] == [3,2,1])` -}
110+{-| Reduce a list from the left.
111+
112+ foldl (::) [] [1,2,3] == [3,2,1]
113+-}
98114foldl : (a -> b -> b) -> b -> [a] -> b
99115foldl = Native.List.foldl
100116
101−{-| Reduce a list from the right: `(foldr (+) 0 [1,2,3] == 6)` -}
117+{-| Reduce a list from the right.
118+
119+ foldr (+) 0 [1,2,3] == 6
120+-}
102121foldr : (a -> b -> b) -> b -> [a] -> b
103122foldr = Native.List.foldr
104123
@@ -124,8 +143,9 @@ scanl = Native.List.scanl
124143scanl1 : (a -> a -> a) -> [a] -> [a]
125144scanl1 = Native.List.scanl1
126145
127−{-| Keep only elements that satisfy the predicate:
128−`(filter isEven [1..6] == [2,4,6])`
146+{-| Keep only elements that satisfy the predicate.
147+
148+ filter isEven [1..6] == [2,4,6]
129149-}
130150filter : (a -> Bool) -> [a] -> [a]
131151filter = Native.List.filter
@@ -133,9 +153,7 @@ filter = Native.List.filter
133153{-| Apply a function that may succeed to all values in the list, but only keep
134154the successes.
135155
136− toInt : String -> Maybe Int
137−
138− filterMap toInt ["3", "4.0", "5", "hats"] == [3,5]
156+ filterMap String.toInt ["3", "4.0", "5", "hats"] == [3,5]
139157-}
140158filterMap : (a -> Maybe b) -> [a] -> [b]
141159filterMap f xs = foldr (maybeCons f) [] xs
@@ -146,19 +164,35 @@ maybeCons f mx xs =
146164 Just x -> x :: xs
147165 Nothing -> xs
148166
149−{-| Determine the length of a list: `(length [1,2,3] == 3)` -}
167+{-| Determine the length of a list.
168+
169+ length [1,2,3] == 3
170+-}
150171length : [a] -> Int
151172length = Native.List.length
152173
153−{-| Reverse a list. `(reverse [1..4] == [4,3,2,1])` -}
174+{-| Reverse a list.
175+
176+ reverse [1..4] == [4,3,2,1]
177+-}
154178reverse : [a] -> [a]
155179reverse = Native.List.reverse
156180
157−{-| Check to see if all elements satisfy the predicate. -}
181+{-| Determine if all elements satisfy the predicate.
182+
183+ all isEven [2,4] == True
184+ all isEven [2,3] == False
185+ all isEven [] == True
186+-}
158187all : (a -> Bool) -> [a] -> Bool
159188all = Native.List.all
160189
161−{-| Check to see if any elements satisfy the predicate. -}
190+{-| Determine if any elements satisfy the predicate.
191+
192+ any isEven [2,3] == True
193+ any isEven [1,3] == False
194+ any isEven [] == False
195+-}
162196any : (a -> Bool) -> [a] -> Bool
163197any = Native.List.any
164198
@@ -177,19 +211,27 @@ concat = Native.List.concat
177211concatMap : (a -> appendable) -> [a] -> appendable
178212concatMap f list = concat (map f list)
179213
180−{-| Get the sum of the list elements. `(sum [1..4] == 10)` -}
214+{-| Get the sum of the list elements.
215+ sum [1..4] == 10
216+-}
181217sum : [number] -> number
182218sum = foldl (+) 0
183219
184−{-| Get the product of the list elements. `(product [1..4] == 24)` -}
220+{-| Get the product of the list elements.
221+ product [1..4] == 24
222+-}
185223product : [number] -> number
186224product = foldl (*) 1
187225
188−{-| Find the maximum element in a non-empty list: `maximum [1,4,2] == 4` -}
226+{-| Find the maximum element in a non-empty list.
227+ maximum [1,4,2] == 4
228+-}
189229maximum : [comparable] -> comparable
190230maximum = foldl1 max
191231
192−{-| Find the minimum element in a non-empty list: `minimum [3,2,1] == 1` -}
232+{-| Find the minimum element in a non-empty list.
233+ minimum [3,2,1] == 1
234+-}
193235minimum : [comparable] -> comparable
194236minimum = foldl1 min
195237
@@ -242,7 +284,7 @@ zipWith4 = Native.List.zipWith4
242284zipWith5 : (a -> b -> c -> d -> e -> x) -> [a] -> [b] -> [c] -> [d] -> [e] -> [x]
243285zipWith5 = Native.List.zipWith5
244286
245−{-| Decompose a list of tuples.
287+{-| Decompose a list of tuples into a tuple of lists.
246288
247289 unzip [(0, True), (17, False), (1337, True)] == ([0,17,1337], [True,False,True])
248290-}
@@ -251,8 +293,7 @@ unzip =
251293 let step (x,y) (xs, ys) = (x::xs, y::ys)
252294 in foldr step ([], [])
253295
254−{-| Places the given value between all of the lists in the second
255−argument and concatenates the result.
296+{-| Place a value between all elements in a list and concatenates the result.
256297
257298 join "a" ["H","w","ii","n"] == "Hawaiian"
258299-}
@@ -272,21 +313,30 @@ intersperse sep xs =
272313 spersed = foldr step [] tl
273314 in hd :: spersed
274315
275−{-| Take the first n members of a list: `(take 2 [1,2,3,4] == [1,2])` -}
316+{-| Take the first *n* members of a list.
317+
318+ take 2 [1,2,3,4] == [1,2]
319+-}
276320take : Int -> [a] -> [a]
277321take = Native.List.take
278322
279−{-| Drop the first n members of a list: `(drop 2 [1,2,3,4] == [3,4])` -}
323+{-| Drop the first *n* members of a list.
324+
325+ drop 2 [1,2,3,4] == [3,4]
326+-}
280327drop : Int -> [a] -> [a]
281328drop = Native.List.drop
282329
283−{-| Creates a list with *n* copies of a value:
284−`(repeat 3 (0,0) == [(0,0),(0,0),(0,0)]`
330+{-| Create a list with *n* copies of a value:
331+
332+ repeat 3 (0,0) == [(0,0),(0,0),(0,0)]
285333-}
286334repeat : Int -> a -> [a]
287335repeat = Native.List.repeat
288336
289−{-| Sort values from lowest to highest: `sort [3,1,5] == [1,3,5]`
337+{-| Sort values from lowest to highest
338+
339+ sort [3,1,5] == [1,3,5]
290340-}
291341sort : [comparable] -> [comparable]
292342sort = Native.List.sort
libraries/String.elm+12−12
@@ -32,7 +32,7 @@ import Native.Show
3232import Native.String
3333import Maybe (Maybe)
3434
35−{-| Check if a string is empty.
35+{-| Determine if a string is empty.
3636
3737 isEmpty "" == True
3838 isEmpty "the world" == False
@@ -40,7 +40,7 @@ import Maybe (Maybe)
4040isEmpty : String -> Bool
4141isEmpty = Native.String.isEmpty
4242
43−{-| Add a character to the beginning of a string -}
43+{-| Add a character to the beginning of a string. -}
4444cons : Char -> String -> String
4545cons = Native.String.cons
4646
@@ -84,7 +84,7 @@ length = Native.String.length
8484map : (Char -> Char) -> String -> String
8585map = Native.String.map
8686
87−{-| Keep only the characters that satisfy the predicate:
87+{-| Keep only the characters that satisfy the predicate.
8888
8989 filter isDigit "R2-D2" == "22"
9090-}
@@ -98,14 +98,14 @@ filter = Native.String.filter
9898reverse : String -> String
9999reverse = Native.String.reverse
100100
101−{-| Reduce a string from the left:
101+{-| Reduce a string from the left.
102102
103103 foldl cons "" "time" == "emit"
104104-}
105105foldl : (Char -> b -> b) -> b -> String -> b
106106foldl = Native.String.foldl
107107
108−{-| Reduce a string from the right:
108+{-| Reduce a string from the right.
109109
110110 foldr cons "" "time" == "time"
111111-}
@@ -131,7 +131,7 @@ split = Native.String.split
131131join : String -> [String] -> String
132132join = Native.String.join
133133
134−{-| Repeat a string N times.
134+{-| Repeat a string *n* times.
135135
136136 repeat 3 "ha" == "hahaha"
137137-}
@@ -149,19 +149,19 @@ are taken starting from the *end* of the list.
149149slice : Int -> Int -> String -> String
150150slice = Native.String.slice
151151
152−{-| Take N characters from the left side of a string. -}
152+{-| Take *n* characters from the left side of a string. -}
153153left : Int -> String -> String
154154left = Native.String.left
155155
156−{-| Take N characters from the right side of a string. -}
156+{-| Take *n* characters from the right side of a string. -}
157157right : Int -> String -> String
158158right = Native.String.right
159159
160−{-| Drop N characters from the left side of a string. -}
160+{-| Drop *n* characters from the left side of a string. -}
161161dropLeft : Int -> String -> String
162162dropLeft = Native.String.dropLeft
163163
164−{-| Drop N characters from the right side of a string. -}
164+{-| Drop *n* characters from the right side of a string. -}
165165dropRight : Int -> String -> String
166166dropRight = Native.String.dropRight
167167
@@ -237,7 +237,7 @@ toUpper = Native.String.toUpper
237237toLower : String -> String
238238toLower = Native.String.toLower
239239
240−{-| Check to see if *any* characters satisfy a predicate.
240+{-| Determine whether *any* characters satisfy a predicate.
241241
242242 any isDigit "90210" == True
243243 any isDigit "R2-D2" == True
@@ -246,7 +246,7 @@ toLower = Native.String.toLower
246246any : (Char -> Bool) -> String -> Bool
247247any = Native.String.any
248248
249−{-| Check to see if *all* characters satisfy a predicate.
249+{-| Determine whether *all* characters satisfy a predicate.
250250
251251 all isDigit "90210" == True
252252 all isDigit "R2-D2" == False
libraries/Text.elm+21−24
@@ -49,11 +49,10 @@ or a strike out text:
4949-}
5050data Line = Under | Over | Through
5151
52−{-| Representation of all the ways you can style `Text`. If the `typeface` list
53−is empty or the `height` is `Nothing`, the users will fall back on their
54−browser's default settings. The following `Style` is black, 16 pixel tall,
55−underlined, and Times New Roman (assuming that typeface is available on the
56−user's computer):
52+{-| Represents all the ways you can style `Text`. If the `typeface` list is
53+empty or the `height` is `Nothing`, the users will fall back on their browser's
54+default settings. The following `Style` is black, 16 pixel tall, underlined, and
55+Times New Roman (assuming that typeface is available on the user's computer):
5756
5857 { typeface = [ "Times New Roman", "serif" ]
5958 , height = Just 16
@@ -73,7 +72,7 @@ type Style =
7372 }
7473
7574{-| Plain black text. It uses the browsers default typeface and text height.
76−No decorations are used:
75+No decorations are used.
7776
7877 { typeface = []
7978 , height = Nothing
@@ -129,42 +128,42 @@ typeface = Native.Text.typeface
129128monospace : Text -> Text
130129monospace = Native.Text.monospace
131130
132−{-| Create a link by providing a URL and the text of the link:
131+{-| Create a link by providing a URL and the text of the link.
133132
134133 link "http://elm-lang.org" (toText "Elm Website")
135134-}
136135link : String -> Text -> Text
137136link = Native.Text.link
138137
139−{-| Set the height of some text:
138+{-| Set the height of some text.
140139
141140 height 40 (toText "Title")
142141-}
143142height : Float -> Text -> Text
144143height = Native.Text.height
145144
146−{-| Set the color of some text:
145+{-| Set the color of some text.
147146
148147 color red (toText "Red")
149148-}
150149color : Color -> Text -> Text
151150color = Native.Text.color
152151
153−{-| Make text bold:
152+{-| Make text bold.
154153
155154 toText "sometimes you want " ++ bold (toText "emphasis")
156155-}
157156bold : Text -> Text
158157bold = Native.Text.bold
159158
160−{-| Make text italic:
159+{-| Make text italic.
161160
162161 toText "make it " ++ italic (toText "important")
163162-}
164163italic : Text -> Text
165164italic = Native.Text.italic
166165
167−{-| Put lines on text:
166+{-| Put lines on text.
168167
169168 line Under (toText "underlined")
170169 line Over (toText "overlined")
@@ -173,31 +172,31 @@ italic = Native.Text.italic
173172line : Line -> Text -> Text
174173line = Native.Text.line
175174
176−{-| `Text` is aligned along the left side of the text block. This is sometimes
177−known as *ragged right*.
175+{-| Align text along the left side of the text block. This is sometimes known as
176+*ragged right*.
178177-}
179178leftAligned : Text -> Element
180179leftAligned = Native.Text.leftAligned
181180
182−{-| `Text` is aligned along the right side of the text block. This is sometimes
183−known as *ragged left*.
181+{-| Align text along the right side of the text block. This is sometimes known
182+as *ragged left*.
184183-}
185184rightAligned : Text -> Element
186185rightAligned = Native.Text.rightAligned
187186
188−{-| `Text` is centered in the text block. There is equal spacing on either side
189−of a line of text.
187+{-| Center text in the text block. There is equal spacing on either side of a
188+line of text.
190189-}
191190centered : Text -> Element
192191centered = Native.Text.centered
193192
194−{-| `Text` is aligned along the left and right sides of the text block. Word
195−spacing is adjusted to make this possible.
193+{-| Align text along the left and right sides of the text block. Word spacing is
194+adjusted to make this possible.
196195-}
197196justified : Text -> Element
198197justified = Native.Text.justified
199198
200−{-| Display a string with no styling:
199+{-| Display a string with no styling.
201200
202201 plainText string = leftAligned (toText string)
203202-}
@@ -210,11 +209,9 @@ markdown : Element
210209markdown = Native.Text.markdown
211210
212211{-| Convert anything to its textual representation and make it displayable in
213−the browser:
212+the browser. Excellent for debugging.
214213
215214 asText value = leftAligned (monospace (toText (show value)))
216−
217−Excellent for debugging.
218215-}
219216asText : a -> Element
220217asText value =
libraries/Transform2D.elm+12−10
@@ -34,7 +34,7 @@ base case.
3434identity : Transform2D
3535identity = Native.Transform2D.identity
3636
37−{-| Creates a transformation matrix. This lets you create transforms
37+{-| Create a transformation matrix. This lets you create transforms
3838such as scales, shears, reflections, and translations.
3939
4040 matrix a b c d x y
@@ -47,18 +47,20 @@ Note that `x` and `y` are the translation values.
4747matrix : Float -> Float -> Float -> Float -> Float -> Float -> Transform2D
4848matrix = Native.Transform2D.matrix
4949
50−{-| Creates a [rotation matrix](http://en.wikipedia.org/wiki/Rotation_matrix).
50+{-| Create a [rotation matrix](http://en.wikipedia.org/wiki/Rotation_matrix).
5151Given an angle t, it creates a counterclockwise rotation matrix:
5252
53+ rotation t
54+
5355 / cos t -sin t 0 \
5456 \ sin t cos t 0 /
5557-}
5658rotation : Float -> Transform2D
5759rotation = Native.Transform2D.rotation
5860
59−{-| Creates a transformation matrix for translation:
61+{-| Create a transformation matrix for translation.
6062
61− translation x y
63+ translation x y
6264
6365 / 1 0 x \
6466 \ 0 1 y /
@@ -66,9 +68,9 @@ rotation = Native.Transform2D.rotation
6668translation : Float -> Float -> Transform2D
6769translation x y = matrix 1 0 0 1 x y
6870
69−{-| Creates a transformation matrix for scaling by a all directions:
71+{-| Creates a transformation matrix for scaling by a all directions.
7072
71− scale s
73+ scale s
7274
7375 / s 0 0 \
7476 \ 0 s 0 /
@@ -76,17 +78,17 @@ translation x y = matrix 1 0 0 1 x y
7678scale : Float -> Transform2D
7779scale s = matrix s 0 0 s 0 0
7880
79−{-| Creates a transformation for horizontal scaling -}
81+{-| Create a transformation for horizontal scaling. -}
8082scaleX : Float -> Transform2D
8183scaleX x = matrix x 0 0 1 0 0
8284
83−{-| Creates a transformation for vertical scaling -}
85+{-| Create a transformation for vertical scaling. -}
8486scaleY : Float -> Transform2D
8587scaleY y = matrix 1 0 0 y 0 0
8688
87−{-| Multiplies two transforms together:
89+{-| Multiply two transforms together.
8890
89− multiply m n
91+ multiply m n
9092
9193 / ma mb mx \ / na nb nx \
9294 | mc md my | . | nc nd ny |