bytable 0.0.0.0 → 0.0.0.1
raw patch · 2 files changed
+13/−3 lines, 2 filesPVP: minor bump suggested
API additions: PVP suggests at least a minor version bump
API changes (from Hackage documentation)
+ Codec.Bytable: evalBytableM :: BytableM a -> ByteString -> Either String a
+ Codec.Bytable: execBytableM :: BytableM a -> ByteString -> Either String ByteString
Files
- bytable.cabal +2/−2
- src/Codec/Bytable.hs +11/−1
bytable.cabal view
@@ -2,7 +2,7 @@ build-type: Simple name: bytable-version: 0.0.0.0+version: 0.0.0.1 stability: Experimental author: Yoshikuni Jujo <PAF01143@nifty.ne.jp> maintainer: Yoshikuni Jujo <PAF01143@nifty.ne.jp>@@ -28,7 +28,7 @@ source-repository this type: git location: git://github.com/YoshikuniJujo/forest- tag: bytable-0.0.0.0+ tag: bytable-0.0.0.1 library hs-source-dirs: src
src/Codec/Bytable.hs view
@@ -1,6 +1,10 @@ {-# LANGUAGE TupleSections #-} -module Codec.Bytable (BytableM(..), Bytable(..), head, take, null) where+module Codec.Bytable (+ Bytable(..),+ BytableM(..), evalBytableM, execBytableM,+ head, take, null+) where import Prelude hiding (take, head, null) import Control.Applicative(Applicative(..), (<$>))@@ -10,6 +14,12 @@ data BytableM a = BytableM { runBytableM :: BS.ByteString -> Either String (a, BS.ByteString) }++evalBytableM :: BytableM a -> BS.ByteString -> Either String a+evalBytableM m bs = fst <$> runBytableM m bs++execBytableM :: BytableM a -> BS.ByteString -> Either String BS.ByteString+execBytableM m bs = snd <$> runBytableM m bs instance Monad BytableM where return x = BytableM $ \bs -> Right (x, bs)