git.iko.soy
/
binary-bits
readme
files
commits
refs
on
master
help
sign in
Add module Bits, with BinaryBit class and instances
352913f
Lennart Kolmodin
16 years ago
Bits.hs
new file
+22
compare with master
unified
split
@@ -0,0 +1,22 @@
1
+
module
Bits
where
2
+
3
+
import
BitsGet
4
+
import
BitsPut
5
+
6
+
import
Data.Word
7
+
8
+
class
BinaryBit a
where
9
+
putBits
::
Int
->
a
->
BitPut ()
10
+
getBits :: Int
->
BitGet a
11
+
12
+
instance BinaryBit Bool where
13
+
putBits _ = putBool
14
+
getBits _ = getBool
15
+
16
+
instance
BinaryBit Word8
where
17
+
putBits = putWord8
18
+
getBits = getWord8
19
+
20
+
instance
BinaryBit Word16
where
21
+
putBits = putWord16be
22
+
getBits = getWord16be
binary-bits.cabal
+1
−1
@@ -20,7 +20,7 @@ cabal-version: >=1.8
20
20
21
21
22
library
22
library
23
−
exposed-modules: BitsGet
23
+
exposed-modules: BitsGet
, BitsPut, Bits
24
24
25
build-depends: base==4.*, binary, bytestring
25
build-depends: base==4.*, binary, bytestring
26
-- other-modules:
26
-- other-modules:
keys
esc to close
j k
move down, up
enter
open
esc
back, or up a level
1 2 3 4
readme, files, commits, refs
/
filter
y
copy the clone command
c
compare the chosen commit with another (or shift-click both)
?
show or hide this list