diff options
Diffstat (limited to 'src/Hakyll/Error.hs')
| -rw-r--r-- | src/Hakyll/Error.hs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Hakyll/Error.hs b/src/Hakyll/Error.hs index 3ca29d3..35102d4 100644 --- a/src/Hakyll/Error.hs +++ b/src/Hakyll/Error.hs @@ -1,6 +1,8 @@ module Hakyll.Error ( ErrorConv (..) , throwErr + , liftErr + , squashErr , CompilerError ) where @@ -15,10 +17,13 @@ type CompilerError c = ErrorConv c [String] instance ErrorCnv err err where toErr = id +instance Exception c => ErrorCnv c SomeException where + toErr = SomeException + -- instance Functor f => ErrorCnv c err => ErrorCnv (f c) (f err) where -- toErr = fmap toErr -instance Applicative f => ErrorCnv c err => ErrorCnv c (f err) where +instance (Applicative f, ErrorCnv c err) => ErrorCnv c (f err) where toErr = pure . toErr throwErr :: (MonadError err m, ErrorConv c err) => c -> m a |
