packages feed

uni-util 2.3.0.2 → 2.3.0.3

raw patch · 6 files changed

+26/−20 lines, 6 filesdep +network-bsdsetup-changedPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependencies added: network-bsd

API changes (from Hackage documentation)

- Util.BinaryInstances: instance (GHC.Base.Monad m, Util.Binary.HasBinary a m) => Util.Binary.HasBinary (GHC.Base.Maybe a) m
- Util.DeepSeq: instance Util.DeepSeq.DeepSeq a => Util.DeepSeq.DeepSeq (GHC.Base.Maybe a)
+ Util.BinaryInstances: instance (GHC.Base.Monad m, Util.Binary.HasBinary a m) => Util.Binary.HasBinary (GHC.Maybe.Maybe a) m
+ Util.BinaryUtils: instance Control.Monad.Fail.MonadFail m => Control.Monad.Fail.MonadFail (Util.BinaryUtils.ArgMonad arg m)
+ Util.Computation: infixr 0 $$
+ Util.Computation: instance Control.Monad.Fail.MonadFail Util.Computation.WithError
+ Util.Computation: instance Control.Monad.Fail.MonadFail m => Control.Monad.Fail.MonadFail (Util.Computation.MonadWithError m)
+ Util.DeepSeq: instance Util.DeepSeq.DeepSeq a => Util.DeepSeq.DeepSeq (GHC.Maybe.Maybe a)
- Util.AtomString: mkFromStringWE :: Parser stringClass -> String -> (String -> WithError stringClass)
+ Util.AtomString: mkFromStringWE :: Parser stringClass -> String -> String -> WithError stringClass
- Util.Binary: ReadBinary :: m Byte -> Int -> m Bytes -> ReadBinary m
+ Util.Binary: ReadBinary :: m Byte -> (Int -> m Bytes) -> ReadBinary m
- Util.Binary: WriteBinary :: Byte -> m () -> Bytes -> Int -> m () -> WriteBinary m
+ Util.Binary: WriteBinary :: (Byte -> m ()) -> (Bytes -> Int -> m ()) -> WriteBinary m
- Util.BinaryInstances: wrap2 :: (HasBinary (val1, val2) m) => Byte -> (val1 -> val2 -> wrapper) -> Wrap wrapper m
+ Util.BinaryInstances: wrap2 :: HasBinary (val1, val2) m => Byte -> (val1 -> val2 -> wrapper) -> Wrap wrapper m
- Util.BinaryInstances: wrap3 :: (HasBinary (val1, val2, val3) m) => Byte -> (val1 -> val2 -> val3 -> wrapper) -> Wrap wrapper m
+ Util.BinaryInstances: wrap3 :: HasBinary (val1, val2, val3) m => Byte -> (val1 -> val2 -> val3 -> wrapper) -> Wrap wrapper m
- Util.BinaryInstances: wrap4 :: (HasBinary (val1, val2, val3, val4) m) => Byte -> (val1 -> val2 -> val3 -> val4 -> wrapper) -> Wrap wrapper m
+ Util.BinaryInstances: wrap4 :: HasBinary (val1, val2, val3, val4) m => Byte -> (val1 -> val2 -> val3 -> val4 -> wrapper) -> Wrap wrapper m
- Util.BinaryUtils: mapRead :: (Monad m, HasBinary b m) => (b -> a) -> (ReadBinary m -> m a)
+ Util.BinaryUtils: mapRead :: (Monad m, HasBinary b m) => (b -> a) -> ReadBinary m -> m a
- Util.BinaryUtils: mapReadIO :: (HasBinary b m, MonadIO m) => (b -> IO a) -> (ReadBinary m -> m a)
+ Util.BinaryUtils: mapReadIO :: (HasBinary b m, MonadIO m) => (b -> IO a) -> ReadBinary m -> m a
- Util.BinaryUtils: mapWrite :: HasBinary b m => (a -> b) -> (WriteBinary m -> a -> m ())
+ Util.BinaryUtils: mapWrite :: HasBinary b m => (a -> b) -> WriteBinary m -> a -> m ()
- Util.BinaryUtils: mapWriteIO :: (HasBinary b m, MonadIO m) => (a -> IO b) -> (WriteBinary m -> a -> m ())
+ Util.BinaryUtils: mapWriteIO :: (HasBinary b m, MonadIO m) => (a -> IO b) -> WriteBinary m -> a -> m ()
- Util.Computation: MonadWithError :: (m (WithError a)) -> MonadWithError m a
+ Util.Computation: MonadWithError :: m (WithError a) -> MonadWithError m a
- Util.Computation: try :: Exception e => IO a -> IO Either e a
+ Util.Computation: try :: Exception e => IO a -> IO (Either e a)
- Util.DeepSeq: ($!!) :: (DeepSeq a) => (a -> b) -> a -> b
+ Util.DeepSeq: ($!!) :: DeepSeq a => (a -> b) -> a -> b
- Util.ExtendedPrelude: generalisedMerge :: (Monad m) => [a] -> [b] -> (a -> b -> Ordering) -> (Maybe a -> Maybe b -> m (Maybe a, Maybe c)) -> m ([a], [c])
+ Util.ExtendedPrelude: generalisedMerge :: Monad m => [a] -> [b] -> (a -> b -> Ordering) -> (Maybe a -> Maybe b -> m (Maybe a, Maybe c)) -> m ([a], [c])
- Util.ExtendedPrelude: mapEq :: Eq a => (b -> a) -> (b -> b -> Bool)
+ Util.ExtendedPrelude: mapEq :: Eq a => (b -> a) -> b -> b -> Bool
- Util.ExtendedPrelude: mapOrd :: Ord a => (b -> a) -> (b -> b -> Ordering)
+ Util.ExtendedPrelude: mapOrd :: Ord a => (b -> a) -> b -> b -> Ordering
- Util.ExtendedPrelude: monadDot :: Monad m => (b -> m c) -> (a -> m b) -> (a -> m c)
+ Util.ExtendedPrelude: monadDot :: Monad m => (b -> m c) -> (a -> m b) -> a -> m c
- Util.ICStringLen: fromUTF8WE :: (Enum byte, Monad m) => [byte] -> m String
+ Util.ICStringLen: fromUTF8WE :: (Enum byte, MonadFail m) => [byte] -> m String
- Util.Messages: MessFns :: String -> IO () -> String -> IO () -> String -> IO () -> String -> IO Bool -> String -> IO () -> Bool -> MessFns
+ Util.Messages: MessFns :: (String -> IO ()) -> (String -> IO ()) -> (String -> IO ()) -> (String -> IO Bool) -> (String -> IO ()) -> Bool -> MessFns
- Util.Myers: diff :: (Eq a) => [a] -> [a] -> [DiffElement a]
+ Util.Myers: diff :: Eq a => [a] -> [a] -> [DiffElement a]
- Util.Sources: SimpleSource :: (Source x x) -> SimpleSource x
+ Util.Sources: SimpleSource :: Source x x -> SimpleSource x
- Util.UTF8: fromUTF8WE :: (Enum byte, Monad m) => [byte] -> m String
+ Util.UTF8: fromUTF8WE :: (Enum byte, MonadFail m) => [byte] -> m String
- Util.VariableList: ListDrawer :: Maybe pos -> Maybe a -> IO pos -> pos -> Maybe a -> IO () -> pos -> IO () -> IO () -> ListDrawer a pos
+ Util.VariableList: ListDrawer :: (Maybe pos -> Maybe a -> IO pos) -> (pos -> Maybe a -> IO ()) -> (pos -> IO ()) -> IO () -> ListDrawer a pos
- Util.VariableMap: VariableMapUpdate :: (VariableSetUpdate (key, elt)) -> VariableMapUpdate key elt
+ Util.VariableMap: VariableMapUpdate :: VariableSetUpdate (key, elt) -> VariableMapUpdate key elt
- Util.VariableSet: VariableSet :: (Broadcaster (VariableSetData x) (VariableSetUpdate x)) -> VariableSet x
+ Util.VariableSet: VariableSet :: Broadcaster (VariableSetData x) (VariableSetUpdate x) -> VariableSet x

Files

− Setup.hs
@@ -1,2 +0,0 @@-import Distribution.Simple-main = defaultMain
Util/BinaryInstances.hs view
@@ -35,6 +35,7 @@ import Data.Char  -- GHC modules+import Control.Monad.Fail import Data.Bits import Data.Word import GHC.Int(Int32)@@ -159,7 +160,7 @@          case switch of             0 -> return False             1 -> return True-            _ -> fail ("BinaryInstances.Bool - unexpected switch "+            _ -> error ("BinaryInstances.Bool - unexpected switch "                ++ show switch)  @@ -438,7 +439,7 @@                 do                    v <- readBin rb                    return (Choice5 v)-            _ -> fail ("BinaryInstances.Choice5 - unexpected switch "+            _ -> error ("BinaryInstances.Choice5 - unexpected switch "                ++ show switch)  -- ----------------------------------------------------------------------@@ -538,7 +539,7 @@                )             (wraps :: [Wrap wrapper m]) of -            Nothing -> fail ("BinaryInstances.Wrapper - bad switch "+            Nothing -> error ("BinaryInstances.Wrapper - bad switch "                ++ show thisLabel)             Just (getWrap :: m (Wrapped wrapper)) -> getWrap 
Util/BinaryUtils.hs view
@@ -69,6 +69,7 @@  -- GHC imports import Control.Applicative+import Control.Monad.Fail import Control.Monad.Trans  -- our imports@@ -166,7 +167,8 @@     return v = ArgMonad (const (return v)) -   fail s = ArgMonad (const (fail s))+instance MonadFail m => MonadFail (ArgMonad arg m) where+   fail s = ArgMonad (const (Control.Monad.Fail.fail s))  instance MonadIO m => MonadIO (ArgMonad arg m) where    liftIO act = ArgMonad (\ arg -> liftIO act)
Util/Computation.hs view
@@ -107,6 +107,7 @@  import Control.Applicative import Control.Monad+import Control.Monad.Fail  import Control.Exception @@ -310,6 +311,8 @@    return v = hasValue v    (>>=) aWE toBWe =       mapWithError' toBWe aWE++instance MonadFail WithError where    fail s = hasError s  newtype MonadWithError m a = MonadWithError (m (WithError a))@@ -335,6 +338,7 @@                      act2                Error s -> return (Error s)          )+instance MonadFail m => MonadFail (MonadWithError m) where    fail s = MonadWithError (return (Error s))  monadifyWithError :: Monad m => WithError a -> MonadWithError m a
Util/UTF8.hs view
@@ -23,6 +23,7 @@ import Data.Bits import Data.Word import Control.Monad.Except () -- needed for instance Monad (Either String)+import Control.Monad.Fail  import Util.Computation @@ -76,7 +77,7 @@ -- (fromUTF8WE :: String -> Either String String) -- to get a conversion function which either succeeds (Right) or -- returns an error message (Left).-fromUTF8WE :: (Enum byte,Monad m) => [byte] -> m String+fromUTF8WE :: (Enum byte,MonadFail m) => [byte] -> m String fromUTF8WE [] = return [] fromUTF8WE (x0 : xs0) =    let@@ -88,11 +89,11 @@                xs1 <- fromUTF8WE xs0                return (chr ox : xs1)          6 ->-            fail "UTF8 escape sequence starts 10xxxxxx"+            Control.Monad.Fail.fail "UTF8 escape sequence starts 10xxxxxx"          0 ->-            fail "UTF8 escape sequence starts 11111110"+            Control.Monad.Fail.fail "UTF8 escape sequence starts 11111110"          -1 ->-            fail "UTF8 escape sequence starts 11111111"+            Control.Monad.Fail.fail "UTF8 escape sequence starts 11111111"          n ->             let                r = 6 - n -- number of 6-bit pieces@@ -108,14 +109,14 @@                      )                 mkx [] _ _ =-                  fail "UTF8 string ends in middle of escape sequence"+                  Control.Monad.Fail.fail "UTF8 string ends in middle of escape sequence"                mkx (ch : xs1) x0 count0 =                   do                      let                         och = fromEnum ch                      if och .&. 0x80 /= 0x80                         then-                           fail ("UTF8 escape sequence contains continuing "+                           Control.Monad.Fail.fail ("UTF8 escape sequence contains continuing "                               ++ "character not of form 10xxxxxx")                         else                            return ()@@ -133,7 +134,7 @@                   (x,xs1) <- mkx xs0 xtop r                   if x < minx                      then-                        fail ("UTF8 escape sequence contains character not "+                        Control.Monad.Fail.fail ("UTF8 escape sequence contains character not "                            ++ "optimally encoded")                      else                         do@@ -142,8 +143,6 @@  {-# SPECIALIZE fromUTF8WE :: String -> WithError String #-} {-# SPECIALIZE fromUTF8WE :: [Word8] -> WithError String #-}-{-# SPECIALIZE fromUTF8WE :: String -> Either String String #-}-{-# SPECIALIZE fromUTF8WE :: [Word8] -> Either String String #-}   -- --------------------------------------------------------------------------
uni-util.cabal view
@@ -1,5 +1,5 @@ name:           uni-util-version:        2.3.0.2+version:        2.3.0.3 build-type:     Simple license:        LGPL license-file:   LICENSE@@ -13,9 +13,9 @@  old HTk- und uDrawGraph bindings as well as for the MMiSS Workbench.  They are kept for compatibility reason and put on hackage to ease  installation.-cabal-version:  >= 1.4-Tested-With:    GHC==7.10.3, GHC==8.2.2, GHC==8.4.3-                +cabal-version:  >= 1.10+Tested-With:    GHC==8.6.5, GHC==8.8.4+ extra-source-files: include/new_object.h include/default_options.h  flag base4@@ -50,7 +50,7 @@  c-sources: new_object.c, default_options.c   build-depends: base >= 4 && < 5, mtl, directory,-  network, containers, bytestring, array, old-time+  network, network-bsd, containers, bytestring, array, old-time   if flag(base4)    build-depends: ghc-prim@@ -65,3 +65,5 @@   if os(windows)    cpp-options: -DWINDOWS++ default-language: Haskell2010