summaryrefslogtreecommitdiff
path: root/src/Hakyll/Error.hs
diff options
context:
space:
mode:
authorChris Wells <chris@mathematicaster.org>2025-01-14 11:48:09 -0600
committerChris Wells <chris@mathematicaster.org>2025-01-14 11:48:09 -0600
commitdae3dca29075d5de8c4c51b3eab9bf0334866c9a (patch)
treed30e1f3186330ca5750df70aefb5050d0105d18b /src/Hakyll/Error.hs
parent1a3ecbb58d85f70be0625777f9deb9a58907d2e2 (diff)
downloadmain-dae3dca29075d5de8c4c51b3eab9bf0334866c9a.tar
main-dae3dca29075d5de8c4c51b3eab9bf0334866c9a.tar.gz
main-dae3dca29075d5de8c4c51b3eab9bf0334866c9a.tar.bz2
main-dae3dca29075d5de8c4c51b3eab9bf0334866c9a.tar.lz
main-dae3dca29075d5de8c4c51b3eab9bf0334866c9a.tar.xz
main-dae3dca29075d5de8c4c51b3eab9bf0334866c9a.tar.zst
main-dae3dca29075d5de8c4c51b3eab9bf0334866c9a.zip
Adding new modules
Diffstat (limited to 'src/Hakyll/Error.hs')
-rw-r--r--src/Hakyll/Error.hs7
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