Hello community,
here is the log from the commit of package ghc-explicit-exception for
openSUSE:Factory checked in at 2017-06-22 10:37:24
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-explicit-exception (Old)
and /work/SRC/openSUSE:Factory/.ghc-explicit-exception.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-explicit-exception"
Thu Jun 22 10:37:24 2017 rev:2 rq:504065 version:0.1.9
Changes:
--------
---
/work/SRC/openSUSE:Factory/ghc-explicit-exception/ghc-explicit-exception.changes
2016-11-01 09:51:37.000000000 +0100
+++
/work/SRC/openSUSE:Factory/.ghc-explicit-exception.new/ghc-explicit-exception.changes
2017-06-22 10:37:25.202770830 +0200
@@ -1,0 +2,5 @@
+Thu Jun 8 11:08:23 UTC 2017 - [email protected]
+
+- Update to version 0.1.9.
+
+-------------------------------------------------------------------
Old:
----
explicit-exception-0.1.8.tar.gz
New:
----
explicit-exception-0.1.9.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-explicit-exception.spec ++++++
--- /var/tmp/diff_new_pack.uhRksu/_old 2017-06-22 10:37:25.850679491 +0200
+++ /var/tmp/diff_new_pack.uhRksu/_new 2017-06-22 10:37:25.854678928 +0200
@@ -1,7 +1,7 @@
#
# spec file for package ghc-explicit-exception
#
-# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -18,20 +18,18 @@
%global pkg_name explicit-exception
Name: ghc-%{pkg_name}
-Version: 0.1.8
+Version: 0.1.9
Release: 0
Summary: Exceptions which are explicit in the type signature
License: BSD-3-Clause
-Group: System/Libraries
+Group: Development/Languages/Other
Url: https://hackage.haskell.org/package/%{pkg_name}
Source0:
https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{version}.tar.gz
BuildRequires: ghc-Cabal-devel
-# Begin cabal-rpm deps:
BuildRequires: ghc-deepseq-devel
BuildRequires: ghc-rpm-macros
BuildRequires: ghc-transformers-devel
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-# End cabal-rpm deps
%description
Synchronous and Asynchronous exceptions which are explicit in the type
@@ -52,10 +50,7 @@
Library (partially intended for unqualified use) I have tried to adopt it for
this library, in order to let Haskell programmers get accustomed easily to it.
-To do: Because many people requested it, we will provide a 'bracket' function
-that frees a resource both when an exception and an error occurs, that is, it
-combines exception handling and debugging. However note that freeing resources
-in case of an error is dangerous and may cause further damage.
+See also: 'unexceptionalio'.
%package devel
Summary: Haskell %{pkg_name} library development files
@@ -72,15 +67,12 @@
%prep
%setup -q -n %{pkg_name}-%{version}
-
%build
%ghc_lib_build
-
%install
%ghc_lib_install
-
%post devel
%ghc_pkg_recache
++++++ explicit-exception-0.1.8.tar.gz -> explicit-exception-0.1.9.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/explicit-exception-0.1.8/explicit-exception.cabal
new/explicit-exception-0.1.9/explicit-exception.cabal
--- old/explicit-exception-0.1.8/explicit-exception.cabal 2016-01-10
22:37:45.000000000 +0100
+++ new/explicit-exception-0.1.9/explicit-exception.cabal 2017-06-03
10:16:11.000000000 +0200
@@ -1,5 +1,5 @@
Name: explicit-exception
-Version: 0.1.8
+Version: 0.1.9
License: BSD3
License-File: LICENSE
Author: Henning Thielemann <[email protected]>
@@ -28,13 +28,7 @@
I have tried to adopt it for this library,
in order to let Haskell programmers get accustomed easily to it.
.
- To do:
- Because many people requested it,
- we will provide a @bracket@ function that frees a resource
- both when an exception and an error occurs,
- that is, it combines exception handling and debugging.
- However note that freeing resources in case of an error is dangerous
- and may cause further damage.
+ See also: @unexceptionalio@
Tested-With: GHC==6.8.2
Tested-With: GHC==7.4.2, GHC==7.6.1, GHC==7.8.2
Tested-With: GHC==8.0.1
@@ -48,7 +42,7 @@
Source-Repository this
type: darcs
location: http://code.haskell.org/explicit-exception/
- tag: 0.1.8
+ tag: 0.1.9
Flag buildTests
description: Build executables that demonstrate some space leaks
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/explicit-exception-0.1.8/src/Control/Monad/Exception/Synchronous.hs
new/explicit-exception-0.1.9/src/Control/Monad/Exception/Synchronous.hs
--- old/explicit-exception-0.1.8/src/Control/Monad/Exception/Synchronous.hs
2016-01-10 22:37:45.000000000 +0100
+++ new/explicit-exception-0.1.9/src/Control/Monad/Exception/Synchronous.hs
2017-06-03 10:16:11.000000000 +0200
@@ -42,12 +42,14 @@
catch,
resolve,
merge,
+ alternative,
ExceptionalT(..),
fromMaybeT, toMaybeT,
fromErrorT, toErrorT,
fromEitherT, toEitherT,
fromExitCodeT, toExitCodeT,
+ liftT,
switchT,
forceT,
mapExceptionT,
@@ -61,6 +63,7 @@
manyT,
manyMonoidT,
mergeT,
+ alternativeT,
) where
import Control.Applicative (Applicative(pure, (<*>)))
@@ -197,6 +200,14 @@
Success a -> a
Exception e -> handler e
+-- like Applicative.<|>
+infixl 3 `alternative`, `alternativeT`
+
+alternative, _alternative ::
+ Exceptional e a -> Exceptional e a -> Exceptional e a
+alternative x y = catch x (const y)
+_alternative x y = switch (const y) Success x
+
-- like Applicative.<*>
@@ -317,6 +328,10 @@
ExceptionalT $ fmap fromExitCode act
+liftT :: (Monad m) => Exceptional e a -> ExceptionalT e m a
+liftT = ExceptionalT . return
+
+
switchT ::
(Monad m) =>
(e -> m b) -> (a -> m b) ->
@@ -358,11 +373,7 @@
(e0 -> ExceptionalT e1 m a) ->
ExceptionalT e1 m a
catchT action handler =
- ExceptionalT $
- runExceptionalT action >>= \x ->
- case x of
- Success a -> return $ Success a
- Exception e -> runExceptionalT $ handler e
+ ExceptionalT $ switchT (runExceptionalT . handler) (return . Success) action
{- |
If the enclosed monad has custom exception facilities,
@@ -445,6 +456,13 @@
ExceptionalT $
liftM2 merge (runExceptionalT mf) (runExceptionalT ma)
+alternativeT, _alternativeT ::
+ (Monad m) =>
+ ExceptionalT e m a -> ExceptionalT e m a -> ExceptionalT e m a
+alternativeT x y = catchT x (const y)
+_alternativeT x y =
+ ExceptionalT $ switchT (const $ runExceptionalT y) (return . Success) x
+
instance Functor m => Functor (ExceptionalT e m) where
fmap f (ExceptionalT x) =