on master help sign in
Improve documentation for the new libraries
123fb94Evan Czaplicki
libraries/Bitwise.elm+6−6
@@ -13,22 +13,22 @@ module Bitwise where
13
13
14import Native.Bitwise
14import Native.Bitwise
15
15
16−{-| Bitwise “and”
16+{-| Bitwise AND
17-}
17-}
18and : Int -> Int -> Int
18and : Int -> Int -> Int
19and = Native.Bitwise.and
19and = Native.Bitwise.and
20
20
21−{-| Bitwise “or”
21+{-| Bitwise OR
22-}
22-}
23or : Int -> Int -> Int
23or : Int -> Int -> Int
24or = Native.Bitwise.or
24or = Native.Bitwise.or
25
25
26−{-| Bitwise “xor”
26+{-| Bitwise XOR
27-}
27-}
28xor : Int -> Int -> Int
28xor : Int -> Int -> Int
29xor = Native.Bitwise.xor
29xor = Native.Bitwise.xor
30
30
31−{-| Flip each bit individually, often called “bitwise not”
31+{-| Flip each bit individually, often called bitwise NOT
32-}
32-}
33complement : Int -> Int
33complement : Int -> Int
34complement = Native.Bitwise.complement
34complement = Native.Bitwise.complement
@@ -51,7 +51,7 @@ whatever is the topmost bit. This can be used to divide numbers by powers of two
51
51
52This is called an [arithmatic right
52This is called an [arithmatic right
53shift](http://en.wikipedia.org/wiki/Bitwise_operation#Arithmetic_shift),
53shift](http://en.wikipedia.org/wiki/Bitwise_operation#Arithmetic_shift),
54−often written (>>), and sometimes called a “sign-propagating”
54+often written (>>), and sometimes called a sign-propagating
55right shift because it fills empty spots with copies of the highest bit.
55right shift because it fills empty spots with copies of the highest bit.
56-}
56-}
57shiftRight : Int -> Int -> Int
57shiftRight : Int -> Int -> Int
@@ -66,7 +66,7 @@ zeros.
66
66
67This is called an [logical right
67This is called an [logical right
68shift](http://en.wikipedia.org/wiki/Bitwise_operation#Logical_shift), often written (>>>),
68shift](http://en.wikipedia.org/wiki/Bitwise_operation#Logical_shift), often written (>>>),
69−and sometimes called a “zero-fill” right shift because it fills empty spots
69+and sometimes called a zero-fill right shift because it fills empty spots
70with zeros.
70with zeros.
71-}
71-}
72shiftRightLogical : Int -> Int -> Int
72shiftRightLogical : Int -> Int -> Int
libraries/Transform2D.elm+7−5
@@ -1,14 +1,16 @@
1module Transform2D where
1module Transform2D where
2−{-| A library for performing [2D matrix transformations](http://en.wikipedia.org/wiki/Transformation_matrix#Affine_transformations).
2+{-| A library for performing [2D matrix transformations][affine].
3It is used primarily with the `groupTransform` function from `Graphics.Collage` and
3It is used primarily with the `groupTransform` function from `Graphics.Collage` and
4allows you to do things like rotation, scaling, translation, shearing, and reflection.
4allows you to do things like rotation, scaling, translation, shearing, and reflection.
5
5
6Note that all the matrices in this library are 3x3 matrices of homogeneous
6Note that all the matrices in this library are 3x3 matrices of homogeneous
7−coordinates, used for affine transformations. Since the third row as always 0 0
7+coordinates, used for [affine transformations][affine]. Since the bottom row as
8−1, we omit this below.
8+always `0 0 1` in these matrices, it is omitted in the diagrams below.
9
9
10+ [affine]: http://en.wikipedia.org/wiki/Transformation_matrix#Affine_transformations
11+
10−# Basic Transforms
12+# Transforms
11−@docs identity, matrix, rotation
13+@docs identity, matrix, rotation, translation, scale, scaleX, scaleY
12
14
13# Multiplication
15# Multiplication
14@docs multiply
16@docs multiply