bytable 0.0.0.5 → 0.0.0.6
raw patch · 2 files changed
+11/−3 lines, 2 filesdep +word24PVP: minor bump suggested
API additions: PVP suggests at least a minor version bump
Dependencies added: word24
API changes (from Hackage documentation)
+ Codec.Bytable.BigEndian: instance Bytable Word24
Files
- bytable.cabal +3/−3
- src/Codec/Bytable/BigEndian.hs +8/−0
bytable.cabal view
@@ -2,7 +2,7 @@ build-type: Simple name: bytable-version: 0.0.0.5+version: 0.0.0.6 stability: Experimental author: Yoshikuni Jujo <PAF01143@nifty.ne.jp> maintainer: Yoshikuni Jujo <PAF01143@nifty.ne.jp>@@ -28,10 +28,10 @@ source-repository this type: git location: git://github.com/YoshikuniJujo/forest- tag: bytable-0.0.0.5+ tag: bytable-0.0.0.6 library hs-source-dirs: src exposed-modules: Codec.Bytable, Codec.Bytable.BigEndian- build-depends: base == 4.*, bytestring == 0.10.*+ build-depends: base == 4.*, bytestring == 0.10.*, word24 == 1.0.* ghc-options: -Wall
src/Codec/Bytable/BigEndian.hs view
@@ -4,6 +4,7 @@ import Data.Bits import Data.Word+import Data.Word.Word24 import Codec.Bytable import qualified Data.ByteString as BS @@ -24,6 +25,13 @@ | otherwise = Left "Codec.Bytable.BigEndian: Bytable Word16: too large" toByteString = integralToByteStringN 2++instance Bytable Word24 where+ fromByteString bs+ | BS.length bs <= 3 = Right $ byteStringToNum bs+ | otherwise = Left+ "Codec.Bytable.BigEndian: Bytable Word24: too large"+ toByteString = integralToByteStringN 3 instance Bytable Word32 where fromByteString bs