packages feed

attempt 0.3.0 → 0.3.1

raw patch · 2 files changed

+8/−1 lines, 2 files

Files

Data/Attempt.hs view
@@ -3,6 +3,8 @@ {-# LANGUAGE ExistentialQuantification #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE Rank2Types #-}+{-# LANGUAGE TypeFamilies #-}+ --------------------------------------------------------- -- -- Module        : Data.Attempt@@ -79,6 +81,11 @@ instance E.Exception e => WrapFailure e Attempt where     wrapFailure _ (Success v) = Success v     wrapFailure f (Failure e) = Failure $ f e++instance Try Attempt where+    type Error Attempt = E.SomeException+    try (Success v) = return v+    try (Failure e) = failure $ E.toException e  -- | Any type which can be converted from an 'Attempt'. The included instances are your \"usual suspects\" for dealing with error handling. They include: --
attempt.cabal view
@@ -1,5 +1,5 @@ name:            attempt-version:         0.3.0+version:         0.3.1 license:         BSD3 license-file:    LICENSE author:          Michael Snoyman, Nicolas Pouillard