handle-like 0.0.0.12 → 0.0.0.13
raw patch · 2 files changed
+6/−4 lines, 2 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
+ Data.HandleLike.Class: instance Eq Priority
+ Data.HandleLike.Class: instance Ord Priority
- Data.HandleLike: class (Monad (HandleMonad h), IsString (DebugLevel h)) => HandleLike h where type family HandleMonad h type family DebugLevel h type instance DebugLevel h = Priority hlGetByte h = do { [b] <- unpack `liftM` hlGet h 1; return b } hlGetLine h = do { b <- hlGetByte h; case b of { 10 -> return "" _ -> cons b `liftM` hlGetLine h } } hlGetContent = flip hlGet 1 hlFlush _ = return () hlDebug _ _ _ = return () hlError _ msg = error $ unpack msg
+ Data.HandleLike: class (Monad (HandleMonad h), IsString (DebugLevel h), Ord (DebugLevel h)) => HandleLike h where type family HandleMonad h type family DebugLevel h type instance DebugLevel h = Priority hlGetByte h = do { [b] <- unpack `liftM` hlGet h 1; return b } hlGetLine h = do { b <- hlGetByte h; case b of { 10 -> return "" _ -> cons b `liftM` hlGetLine h } } hlGetContent = flip hlGet 1 hlFlush _ = return () hlDebug _ _ _ = return () hlError _ msg = error $ unpack msg
- Data.HandleLike.Class: class (Monad (HandleMonad h), IsString (DebugLevel h)) => HandleLike h where type family HandleMonad h type family DebugLevel h type instance DebugLevel h = Priority hlGetByte h = do { [b] <- unpack `liftM` hlGet h 1; return b } hlGetLine h = do { b <- hlGetByte h; case b of { 10 -> return "" _ -> cons b `liftM` hlGetLine h } } hlGetContent = flip hlGet 1 hlFlush _ = return () hlDebug _ _ _ = return () hlError _ msg = error $ unpack msg
+ Data.HandleLike.Class: class (Monad (HandleMonad h), IsString (DebugLevel h), Ord (DebugLevel h)) => HandleLike h where type family HandleMonad h type family DebugLevel h type instance DebugLevel h = Priority hlGetByte h = do { [b] <- unpack `liftM` hlGet h 1; return b } hlGetLine h = do { b <- hlGetByte h; case b of { 10 -> return "" _ -> cons b `liftM` hlGetLine h } } hlGetContent = flip hlGet 1 hlFlush _ = return () hlDebug _ _ _ = return () hlError _ msg = error $ unpack msg
Files
- handle-like.cabal +2/−2
- src/Data/HandleLike/Class.hs +4/−2
handle-like.cabal view
@@ -2,7 +2,7 @@ build-type: Simple name: handle-like-version: 0.0.0.12+version: 0.0.0.13 stability: Experimental author: Yoshikuni Jujo <PAF01143@nifty.ne.jp> maintainer: Yoshikuni Jujo <PAF01143@nifty.ne.jp>@@ -38,7 +38,7 @@ source-repository this type: git location: git://github.com/YoshikuniJujo/forest- tag: handle-like-0.0.0.12+ tag: handle-like-0.0.0.13 library hs-source-dirs: src
src/Data/HandleLike/Class.hs view
@@ -11,7 +11,8 @@ import qualified Data.ByteString.Char8 as BSC import Data.String -class (Monad (HandleMonad h), IsString (DebugLevel h)) =>+class (Monad (HandleMonad h),+ IsString (DebugLevel h), Ord (DebugLevel h)) => HandleLike h where type HandleMonad h type DebugLevel h@@ -40,7 +41,8 @@ hlPutStrLn :: HandleLike h => h -> BS.ByteString -> HandleMonad h () hlPutStrLn h = hlPut h . (`BS.append` "\n") -data Priority = Low | Moderate | High | Critical deriving (Show, Read, Enum)+data Priority = Low | Moderate | High | Critical+ deriving (Show, Read, Eq, Ord, Enum) instance IsString Priority where fromString s = case takeWhile (/= ':') s of