summaryrefslogtreecommitdiff
path: root/src/Hakyll/Error.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Hakyll/Error.hs')
-rw-r--r--src/Hakyll/Error.hs16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/Hakyll/Error.hs b/src/Hakyll/Error.hs
index 35102d4..7495b4d 100644
--- a/src/Hakyll/Error.hs
+++ b/src/Hakyll/Error.hs
@@ -14,17 +14,17 @@ class ErrorConv c err where
type CompilerError c = ErrorConv c [String]
-instance ErrorCnv err err where
+instance ErrorConv err err where
toErr = id
-instance Exception c => ErrorCnv c SomeException where
+instance Exception c => ErrorConv c SomeException where
toErr = SomeException
--- instance Functor f => ErrorCnv c err => ErrorCnv (f c) (f err) where
+-- instance Functor f => ErrorConv c err => ErrorConv (f c) (f err) where
-- toErr = fmap toErr
-instance (Applicative f, ErrorCnv c err) => ErrorCnv c (f err) where
- toErr = pure . toErr
+-- instance (Applicative f, ErrorConv c err) => ErrorConv c (f err) where
+-- toErr = pure . toErr
throwErr :: (MonadError err m, ErrorConv c err) => c -> m a
throwErr = throwError . toErr
@@ -38,6 +38,12 @@ squashErr = (>>= liftErr)
instance ErrorConv Message String where
toErr = messageString
+instance ErrorConv String [String] where
+ toErr = pure
+
+instance ErrorConv Message [String] where
+ toErr = pure . messageString
+
instance ErrorConv ParseError [String] where
toErr = fmap messageString . errorMessages