uni-util 2.2.1.1 → 2.2.1.2
raw patch · 3 files changed
+13/−15 lines, 3 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Util.AtomString: class StringClass stringClass
+ Util.AtomString: class StringClass stringClass where fromString s = coerceWithError (fromStringWE s) fromStringWE s = hasValue (fromString s)
- Util.DeepSeq: class DeepSeq a
+ Util.DeepSeq: class DeepSeq a where deepSeq = seq
- Util.Registry: class GetSetRegistry registry from to
+ Util.Registry: class GetSetRegistry registry from to where getValueOpt registry from = transformValue registry from (\ valueOpt -> return (valueOpt, valueOpt)) getValue registry from = do { valueOpt <- getValueOpt registry from; case valueOpt of { Nothing -> error "Registry.getValue - value undefined" Just value -> return value } } setValue registry from to = transformValue registry from (\ _ -> return (Just to, ()))
- Util.Registry: class KeyOpsRegistry registry from
+ Util.Registry: class KeyOpsRegistry registry from where deleteFromRegistry registry from = do { deleteFromRegistryBool registry from; return () }
- Util.Sink: class CanAddSinks sinkSource x delta | sinkSource -> x, sinkSource -> delta
+ Util.Sink: class CanAddSinks sinkSource x delta | sinkSource -> x, sinkSource -> delta where addNewSink sinkSource action = do { parallelX <- newParallelExec; addNewQuickSink sinkSource (\ delta -> parallelExec parallelX (action delta)) } addNewSinkGeneral sinkSource action sinkID = do { parallelX <- newParallelExec; addNewSinkVeryGeneral sinkSource action sinkID parallelX } addNewSinkVeryGeneral sinkSource action sinkID parallelX = addNewQuickSinkGeneral sinkSource (\ delta -> parallelExec parallelX (do { interested <- isInterested sinkID; if interested then action delta else done })) sinkID addNewSinkWithInitial sinkSource xAction deltaAction sinkID parallelX = do { mVar <- newEmptyMVar; let firstAct = do { x <- takeMVar mVar; xAction x }; parallelExec parallelX firstAct; (returnValue@(x, sink)) <- addNewSinkVeryGeneral sinkSource deltaAction sinkID parallelX; putMVar mVar x; return returnValue } addNewQuickSink sinkSource action = do { sink <- newSink action; x <- addOldSink sinkSource sink; return (x, sink) } addNewQuickSinkGeneral sinkSource action sinkID = do { sink <- newSinkGeneral sinkID action; x <- addOldSink sinkSource sink; return (x, sink) }
Files
- Util/Debug.hs +8/−9
- Util/WBFiles.hs +4/−4
- uni-util.cabal +1/−2
Util/Debug.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE CPP #-}+{-# LANGUAGE CPP, ScopedTypeVariables #-} -- | -- MODULE : Debug@@ -39,10 +39,9 @@ -- to the evaluation. ) where import System.IO as IO-import System.IO.Error as IO import System.IO.Unsafe-import Control.Exception+import Control.Exception as Exception import Util.WBFiles @@ -50,13 +49,13 @@ openDebugFile = do debugFileName <- getDebugFileName- IO.catch (+ Exception.catch ( do handle <- openFile debugFileName WriteMode hSetBuffering handle NoBuffering return (Just handle) )- (\ _-> return Nothing)+ (\ (_ :: IOException) -> return Nothing) debugFile = unsafePerformIO openDebugFile debugFile :: Maybe Handle@@ -75,12 +74,12 @@ debugAct mess act = do- res <- Control.Exception.try act+ res <- Exception.try act case res of Left error -> do debug ("Debug.debug caught "++mess)- throw error+ throw (error :: SomeException) Right success -> return success #else@@ -120,7 +119,7 @@ alwaysDebugAct :: String -> IO a -> IO a alwaysDebugAct mess act = do- res <- Control.Exception.try act+ res <- Exception.try act case res of Left error -> do@@ -140,7 +139,7 @@ wrapErrorIO :: String -> a -> IO a wrapErrorIO str value =- Control.Exception.catch (value `seq` return value)+ Exception.catch (value `seq` return value) (\ mess -> error (str ++ ":"++ show (mess :: ErrorCall)))
Util/WBFiles.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE ForeignFunctionInterface #-}+{-# LANGUAGE ForeignFunctionInterface, ScopedTypeVariables #-} -- | -- Description : Option processing@@ -207,12 +207,12 @@ import Data.Char import Util.CompileFlags import System.IO-import System.IO.Error import Data.List import Control.Monad import qualified System.Environment as System import System.Exit(exitWith,ExitCode(..)) +import qualified Control.Exception as Exception import Control.Concurrent import qualified Data.Map as Map import System.IO.Unsafe@@ -843,9 +843,9 @@ let option = optionName arg envVar = "UNI"++(map toUpper option)- valueOpt <- try (System.getEnv envVar)+ valueOpt <- Exception.try (System.getEnv envVar) case valueOpt of- Left error -> return prev+ Left (_ :: Exception.IOException) -> return prev Right newValue -> tryToAddValue (argType arg) option newValue prev
uni-util.cabal view
@@ -1,5 +1,5 @@ name: uni-util-version: 2.2.1.1+version: 2.2.1.2 build-type: Simple license: LGPL license-file: LICENSE@@ -14,7 +14,6 @@ They are kept for compatibility reason and put on hackage to ease installation. cabal-version: >= 1.4-Tested-With: GHC==7.0.2 extra-source-files: include/new_object.h include/default_options.h