on master help sign in
Actually switch to the new module name
commit9c9fcc7a1edaa8b7f3028fcb01993d4cdfe8db15 authorEvan Czaplicki <info@elm-lang.org> dateTue 29 Oct 2013, 19:50 (13 years ago) parent904c224
2 files changed+14−14
libraries/Bitwise.elm+9−9 libraries/Native/Bitwise.js+5−5
libraries/Bitwise.elm+9−9
@@ -1,5 +1,5 @@
11
2−module Bits where
2+module Bitwise where
33
44{-| Library for [bitwise operations](http://en.wikipedia.org/wiki/Bitwise_operation).
55
@@ -12,27 +12,27 @@ module Bits where
1212@docs shiftLeft, shiftRight, shiftRightLogical
1313-}
1414
15−import Native.Bits
15+import Native.Bitwise
1616
1717{-| Bitwise &ldquo;and&rdquo;
1818-}
1919and : Int -> Int -> Int
20−and = Native.Bits.and
20+and = Native.Bitwise.and
2121
2222{-| Bitwise &ldquo;or&rdquo;
2323-}
2424or : Int -> Int -> Int
25−or = Native.Bits.or
25+or = Native.Bitwise.or
2626
2727{-| Bitwise &ldquo;xor&rdquo;
2828-}
2929xor : Int -> Int -> Int
30−xor = Native.Bits.xor
30+xor = Native.Bitwise.xor
3131
3232{-| Flip each bit individually, often called &ldquo;bitwise not&rdquo;
3333-}
3434complement : Int -> Int
35−complement = Native.Bits.complement
35+complement = Native.Bitwise.complement
3636
3737{-| Shift bits to the left by a given offset, filling new bits with zeros.
3838This can be used to multiply numbers by powers of two.
@@ -41,7 +41,7 @@ This can be used to multiply numbers by powers of two.
4141 8 `shiftLeft` 2 == 32
4242-}
4343shiftLeft : Int -> Int -> Int
44−shiftLeft = Native.Bits.shiftLeft
44+shiftLeft = Native.Bitwise.shiftLeft
4545
4646{-| Shift bits to the right by a given offset, filling new bits with
4747whatever is the topmost bit. This can be used to divide numbers by powers of two.
@@ -56,7 +56,7 @@ often written (>>), and sometimes called a &ldquo;sign-propagating&rdquo;
5656right shift because it fills empty spots with copies of the highest bit.
5757-}
5858shiftRight : Int -> Int -> Int
59−shiftRight = Native.Bits.shiftRightArithmatic
59+shiftRight = Native.Bitwise.shiftRightArithmatic
6060
6161{-| Shift bits to the right by a given offset, filling new bits with
6262zeros.
@@ -71,5 +71,5 @@ and sometimes called a &ldquo;zero-fill&rdquo; right shift because it fills empt
7171with zeros.
7272-}
7373shiftRightLogical : Int -> Int -> Int
74−shiftRightLogical = Native.Bits.shiftRightLogical
74+shiftRightLogical = Native.Bitwise.shiftRightLogical
7575
libraries/Native/Bitwise.js+5−5
@@ -1,8 +1,8 @@
1−Elm.Native.Bits = {};
2−Elm.Native.Bits.make = function(elm) {
1+Elm.Native.Bitwise = {};
2+Elm.Native.Bitwise.make = function(elm) {
33 elm.Native = elm.Native || {};
4− elm.Native.Bits = elm.Native.Bits || {};
5− if (elm.Native.Bits.values) return elm.Native.Bits.values;
4+ elm.Native.Bitwise = elm.Native.Bitwise || {};
5+ if (elm.Native.Bitwise.values) return elm.Native.Bitwise.values;
66
77 function and(a,b) { return a & b; }
88 function or (a,b) { return a | b; }
@@ -12,7 +12,7 @@ Elm.Native.Bits.make = function(elm) {
1212 function sra(a,offset) { return a >> offset; }
1313 function srl(a,offset) { return a >>> offset; }
1414
15− return elm.Native.Bits.values = {
15+ return elm.Native.Bitwise.values = {
1616 and: A2(and),
1717 or : A2(or ),
1818 xor: A2(xor),