io-string-like 0.1.0.0 → 0.1.0.1
raw patch · 2 files changed
+10/−30 lines, 2 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- System.IO.StringLike.GetContents: class CanGetContentsClass IO Handle t => CanGetContents t
- System.IO.StringLike.GetLine: class CanGetLineClass IO Handle t => CanGetLine t
- System.IO.StringLike.Impl: class CanGetContentsClass IO Handle t => CanGetContents t
- System.IO.StringLike.Impl: class CanGetLineClass IO Handle t => CanGetLine t
- System.IO.StringLike.Impl: class CanPutStrClass IO Handle t => CanPutStr t
- System.IO.StringLike.Impl: class CanPutStrLnClass IO Handle t => CanPutStrLn t
- System.IO.StringLike.Impl: instance System.IO.StringLike.Impl.CanGetContentsClass GHC.Types.IO GHC.IO.Handle.Types.Handle t => System.IO.StringLike.Impl.CanGetContents t
- System.IO.StringLike.Impl: instance System.IO.StringLike.Impl.CanGetLineClass GHC.Types.IO GHC.IO.Handle.Types.Handle t => System.IO.StringLike.Impl.CanGetLine t
- System.IO.StringLike.Impl: instance System.IO.StringLike.Impl.CanPutStrClass GHC.Types.IO GHC.IO.Handle.Types.Handle t => System.IO.StringLike.Impl.CanPutStr t
- System.IO.StringLike.Impl: instance System.IO.StringLike.Impl.CanPutStrLnClass GHC.Types.IO GHC.IO.Handle.Types.Handle t => System.IO.StringLike.Impl.CanPutStrLn t
- System.IO.StringLike.PutStr: class CanPutStrClass IO Handle t => CanPutStr t
- System.IO.StringLike.PutStrLn: class CanPutStrLnClass IO Handle t => CanPutStrLn t
+ System.IO.StringLike.GetContents: type CanGetContents t = CanGetContentsClass IO Handle t
+ System.IO.StringLike.GetLine: type CanGetLine t = CanGetLineClass IO Handle t
+ System.IO.StringLike.Impl: type CanGetContents t = CanGetContentsClass IO Handle t
+ System.IO.StringLike.Impl: type CanGetLine t = CanGetLineClass IO Handle t
+ System.IO.StringLike.Impl: type CanPutStr t = CanPutStrClass IO Handle t
+ System.IO.StringLike.Impl: type CanPutStrLn t = CanPutStrLnClass IO Handle t
+ System.IO.StringLike.PutStr: type CanPutStr t = CanPutStrClass IO Handle t
+ System.IO.StringLike.PutStrLn: type CanPutStrLn t = CanPutStrLnClass IO Handle t
Files
- io-string-like.cabal +3/−3
- src/System/IO/StringLike/Impl.hs +7/−27
io-string-like.cabal view
@@ -2,14 +2,14 @@ -- -- see: https://github.com/sol/hpack ----- hash: 6d2238ec61b205b3bc42dee2863a5ec675ee3ea54b2cf1a906749d83ff7e4704+-- hash: b851dfc4cd9f6bbbde0424b61d304741d6b63c230fd74572b2a43bbcc494d3f7 name: io-string-like-version: 0.1.0.0+version: 0.1.0.1 synopsis: Classes to handle Prelude style IO functions for different datatypes description: The functions in the Prelude such as "getContents", "putStr" only work for plain Strings. .- There are similar functions in "ByteString" for reading and writing, as well as "Text".+ There are similar functions in "ByteString" for reading and writing, as well as \"Text\". . This requires one to import the appropriate functions, usually qualified, for the particular datatype one is using. Changing the datatype at the very least involves changing import statements across your program. .
src/System/IO/StringLike/Impl.hs view
@@ -84,23 +84,9 @@ -------------------------- {-|-'CanGetContents' if effectively the following type synonym, for the common case of-an ordinary 'Handle' in the 'IO' monad like so.--> type CanGetContents t = CanGetContentsClass IO Handle t--The reason why it's defined as a class with a catch all instance instead is so-modules which use 'CanGetContents' do not have to include the language pragma "FleixbleContexts".--However, this approach requires this module to use the pragma "UndecidableInstances",-but I figure it's better to add more complexity to the library than to clients.--'CanGet', 'CanGetLine', 'CanPutStr', 'CanPutStrLn' all are similar synonyms with-the same explanation for their definition so I won't repeat myself.+Type synonym, for the common case of an ordinary 'Handle' in the 'IO'. -}---type CanGetContents t = CanGetContentsClass IO Handle t-class CanGetContentsClass IO Handle t => CanGetContents t-instance CanGetContentsClass IO Handle t => CanGetContents t+type CanGetContents t = CanGetContentsClass IO Handle t class Monad m => CanGetContentsClass m handleT t where {-| Generalised 'System.IO.hGetContents' -}@@ -121,10 +107,8 @@ -- CanGetLine class -- ---------------------- -{-| Effective type synonym for 'CanGetLineClass'. See 'CanGetContents' for more details. -}---type CanGetLine t = CanGetLineClass IO Handle t-class CanGetLineClass IO Handle t => CanGetLine t-instance CanGetLineClass IO Handle t => CanGetLine t+{-| Type synonym for 'CanGetLineClass'. See 'CanGetContents' for more details. -}+type CanGetLine t = CanGetLineClass IO Handle t class CanGetContentsClass m handleT t => CanGetLineClass m handleT t where {-| Generalised 'System.IO.hGetLine' -}@@ -139,10 +123,8 @@ -- CanPutStr class -- ------------------ -{-| Effective type synonym for 'CanPutStrClass'. See 'CanGetContents' for more details. -}---type CanPutStr t = CanPutStrClass IO Handle t-class CanPutStrClass IO Handle t => CanPutStr t-instance CanPutStrClass IO Handle t => CanPutStr t+{-| Type synonym for 'CanPutStrClass'. See 'CanGetContents' for more details. -}+type CanPutStr t = CanPutStrClass IO Handle t class Monad m => CanPutStrClass m handleT t where {-| Generalised 'System.IO.hPutStr' -}@@ -170,9 +152,7 @@ ------------------------- {-| Effective type synonym for 'CanPutStrLnClass'. See 'CanGetContents' for more details. -}---type CanPutStrLn t = CanPutStrLnClass IO Handle t-class CanPutStrLnClass IO Handle t => CanPutStrLn t-instance CanPutStrLnClass IO Handle t => CanPutStrLn t+type CanPutStrLn t = CanPutStrLnClass IO Handle t class CanPutStrClass m handleT t => CanPutStrLnClass m handleT t where {-| Generalised 'System.IO.hPutStrLn' -}