basic-prelude 0.3.5.0 → 0.3.6.0
raw patch · 3 files changed
+21/−7 lines, 3 filesdep +safePVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependencies added: safe
API changes (from Hackage documentation)
- BasicPrelude: ioError :: IOError -> IO a
- BasicPrelude: type IOError = IOException
- BasicPrelude: userError :: String -> IOError
+ BasicPrelude: decodeUtf8 :: ByteString -> Text
+ BasicPrelude: encodeUtf8 :: Text -> ByteString
+ BasicPrelude: readMay :: Read a => Text -> Maybe a
+ CorePrelude: Down :: a -> Down a
+ CorePrelude: newtype Down a :: * -> *
Files
- BasicPrelude.hs +15/−6
- CorePrelude.hs +4/−0
- basic-prelude.cabal +2/−1
BasicPrelude.hs view
@@ -40,6 +40,8 @@ , Text.unwords , textToString , ltextToString+ , encodeUtf8+ , decodeUtf8 -- ** Text operations (IO) , Text.putStr , Text.getLine@@ -64,14 +66,11 @@ , Prelude.reads , Prelude.readParen , Prelude.lex+ , readMay -- ** IO operations , Prelude.putChar , Prelude.getChar , Prelude.readLn- -- ** Exceptions- , Prelude.IOError- , Prelude.ioError- , Prelude.userError ) where import CorePrelude@@ -105,8 +104,9 @@ import qualified Data.Text.Lazy.IO as LText import qualified Filesystem.Path.CurrentOS as FilePath import qualified Prelude--+import Data.Text.Encoding (encodeUtf8, decodeUtf8With)+import Data.Text.Encoding.Error (lenientDecode)+import qualified Safe -- | > map = fmap map :: (Functor f) => (a -> b) -> f a -> f b@@ -174,3 +174,12 @@ ltextToString :: LText -> Prelude.String ltextToString = LText.unpack++-- | Note that this is /not/ the standard @Data.Text.Encoding.decodeUtf8@. That+-- function will throw impure exceptions on any decoding errors. This function+-- instead uses @decodeLenient@.+decodeUtf8 :: ByteString -> Text+decodeUtf8 = decodeUtf8With lenientDecode++readMay :: Read a => Text -> Maybe a+readMay = Safe.readMay . Text.unpack
CorePrelude.hs view
@@ -115,6 +115,7 @@ , Data.Function.on , Data.Ord.comparing , equating+ , GHC.Exts.Down (..) -- ** Applicative , Control.Applicative.Applicative (..) , (Control.Applicative.<$>)@@ -137,6 +138,7 @@ , Control.Exception.Lifted.bracket , Control.Exception.Lifted.onException , Control.Exception.Lifted.finally+ , module System.IO.Error -- ** Files , F.FilePath , (F.</>)@@ -205,6 +207,8 @@ import qualified System.Environment import qualified Data.Text import qualified Data.List+import System.IO.Error hiding (catch, try)+import qualified GHC.Exts #if MIN_VERSION_base(4,5,0) import Data.Monoid ((<>))
basic-prelude.cabal view
@@ -1,5 +1,5 @@ name: basic-prelude-version: 0.3.5.0+version: 0.3.6.0 synopsis: An enhanced core prelude; a common foundation for alternate preludes. description: The premise of @basic-prelude@ is that there are a lot of very commonly desired features missing from the standard @Prelude@, such as commonly used operators (@\<$\>@ and @>=>@, for instance) and imports for common datatypes (e.g., @ByteString@ and @Vector@). At the same time, there are lots of other components which are more debatable, such as providing polymorphic versions of common functions.@@ -39,6 +39,7 @@ , system-filepath >= 0.4 && < 0.5 , ReadArgs >= 1.2 && < 1.3 , lifted-base+ , safe source-repository head type: git