diff --git a/benchmark/DataTypes.hs b/benchmark/DataTypes.hs
--- a/benchmark/DataTypes.hs
+++ b/benchmark/DataTypes.hs
@@ -1,8 +1,11 @@
-{-# LANGUAGE TypeSynonymInstances, FlexibleInstances #-}
+{-# LANGUAGE TypeSynonymInstances, FlexibleInstances, CPP #-}
 
 module DataTypes where
 
+-- Control.Monad.Fail import is redundant since GHC 8.8.1
+#if !MIN_VERSION_base(4,13,0)
 import Control.Monad.Fail
+#endif
 
 
 type Err = Either String
diff --git a/benchmark/Functions/Comp/Eval.hs b/benchmark/Functions/Comp/Eval.hs
--- a/benchmark/Functions/Comp/Eval.hs
+++ b/benchmark/Functions/Comp/Eval.hs
@@ -7,7 +7,8 @@
   TypeOperators,
   ScopedTypeVariables,
   TypeSynonymInstances,
-  ConstraintKinds #-}
+  ConstraintKinds,
+  CPP #-}
 
 module Functions.Comp.Eval where
 
@@ -17,10 +18,12 @@
 import Data.Comp.Thunk hiding (eval, eval2)
 import Data.Comp.Derive
 
-import Control.Monad.Fail
-import Prelude hiding (fail)
-import Control.Monad hiding (fail)
+-- Control.Monad.Fail import is redundant since GHC 8.8.1
+#if !MIN_VERSION_base(4,13,0)
+import Control.Monad.Fail (MonadFail)
+#endif
 
+import Control.Monad
 
 -- evaluation with thunks
 
diff --git a/benchmark/Functions/Comp/Inference.hs b/benchmark/Functions/Comp/Inference.hs
--- a/benchmark/Functions/Comp/Inference.hs
+++ b/benchmark/Functions/Comp/Inference.hs
@@ -7,7 +7,8 @@
   TypeOperators,
   ScopedTypeVariables,
   TypeSynonymInstances,
-  ConstraintKinds#-}
+  ConstraintKinds,
+  CPP #-}
 
 module Functions.Comp.Inference where
 
@@ -16,6 +17,11 @@
 import Data.Comp
 import Data.Comp.Derive
 
+-- Control.Monad.Fail import is redundant since GHC 8.8.1
+#if !MIN_VERSION_base(4,13,0)
+import Control.Monad.Fail (MonadFail)
+#endif
+
 -- type inference
 
 class Monad m => InferType f t m where
@@ -29,19 +35,19 @@
 
 $(derive [liftSum] [''InferType])
 
-instance (ValueT :<: t, Monad m) => InferType Value t m where
+instance (ValueT :<: t, MonadFail m) => InferType Value t m where
     inferTypeAlg (VInt _) = return $ inject TInt
     inferTypeAlg (VBool _) = return $ inject TBool
     inferTypeAlg (VPair x y) = return $ inject $ TPair x y
 
-checkOp :: (g :<: f, Eq (g (Term f)), Monad m) =>
+checkOp :: (g :<: f, Eq (g (Term f)), MonadFail m) =>
            [g (Term f)] -> g (Term f) -> [Term f] -> m (Term f)
 checkOp exs et tys = if and (zipWith (\ f t -> maybe False (==f) (project t)) exs tys) 
                      then return (inject et)
                      else fail""
 
 
-instance (ValueT :<: t, EqF t, Monad m) => InferType Op t m where
+instance (ValueT :<: t, EqF t, MonadFail m) => InferType Op t m where
     inferTypeAlg (Plus x y) = checkOp [TInt,TInt] TInt [x ,y]
     inferTypeAlg (Mult x y) = checkOp [TInt,TInt] TInt [x ,y]
     inferTypeAlg (Lt x y) = checkOp [TInt,TInt] TBool [x ,y]
@@ -58,7 +64,7 @@
                                       ProjRight -> return x2
                                 _ -> fail ""
 
-instance (ValueT :<: t, EqF t, Monad m) => InferType Sugar t m where
+instance (ValueT :<: t, EqF t, MonadFail m) => InferType Sugar t m where
     inferTypeAlg (Minus x y) = checkOp [TInt,TInt] TInt [x ,y]
     inferTypeAlg (Neg x) = checkOp [TInt] TInt [x]
     inferTypeAlg (Gt x y) = checkOp [TInt,TInt] TBool [x ,y]
diff --git a/benchmark/Functions/Standard/Eval.hs b/benchmark/Functions/Standard/Eval.hs
--- a/benchmark/Functions/Standard/Eval.hs
+++ b/benchmark/Functions/Standard/Eval.hs
@@ -1,22 +1,29 @@
+{-# LANGUAGE CPP                 #-}
+
 module Functions.Standard.Eval where
 
 import DataTypes.Standard
 import Functions.Standard.Desugar
 import Control.Monad
 
-coerceInt :: (Monad m) => SExpr -> m Int
+-- Control.Monad.Fail import is redundant since GHC 8.8.1
+#if !MIN_VERSION_base(4,13,0)
+import Control.Monad.Fail (MonadFail)
+#endif
+
+coerceInt :: (MonadFail m) => SExpr -> m Int
 coerceInt (SInt i) = return i
 coerceInt _ = fail ""
 
-coerceBool :: (Monad m) => SExpr -> m Bool
+coerceBool :: (MonadFail m) => SExpr -> m Bool
 coerceBool (SBool b) = return b
 coerceBool _ = fail ""
 
-coercePair :: (Monad m) => SExpr -> m (SExpr,SExpr)
+coercePair :: (MonadFail m) => SExpr -> m (SExpr,SExpr)
 coercePair (SPair x y) = return (x,y)
 coercePair _ = fail ""
 
-eval :: (Monad m) => OExpr -> m SExpr
+eval :: (MonadFail m) => OExpr -> m SExpr
 eval (OInt i) = return $ SInt i
 eval (OBool b) = return $ SBool b
 eval (OPair x y) = liftM2 SPair (eval x) (eval y)
diff --git a/compdata.cabal b/compdata.cabal
--- a/compdata.cabal
+++ b/compdata.cabal
@@ -1,5 +1,5 @@
 Name:			compdata
-Version:		0.12
+Version:		0.12.1
 Synopsis:            	Compositional Data Types
 Description:
 
@@ -98,7 +98,7 @@
 Author:                 Patrick Bahr, Tom Hvitved
 Maintainer:             paba@itu.dk
 Build-Type:             Simple
-Cabal-Version:          >=1.9.2
+Cabal-Version:          >=1.12
 bug-reports:            https://github.com/pa-ba/compdata/issues
 
 extra-source-files:
@@ -190,10 +190,11 @@
 
 
 
-  Build-Depends:	base >= 4.7, base < 5, template-haskell, containers, mtl >= 2.2.1,
+  Build-Depends:	base >= 4.9, base < 5, template-haskell, containers, mtl >= 2.2.1,
                         QuickCheck >= 2, deepseq, transformers, th-expand-syns,
                         tree-view >= 0.5
-  Extensions:           FlexibleContexts
+  Default-Language:     Haskell2010                                                
+  Default-Extensions:   FlexibleContexts
   hs-source-dirs:	src
   ghc-options:          -W
 
@@ -202,12 +203,87 @@
   Type:                 exitcode-stdio-1.0
   Main-is:		Data_Test.hs
   hs-source-dirs:	testsuite/tests examples src
-  Build-Depends:        base >= 4.7, base < 5, template-haskell, containers, mtl >= 2.2.1,
+  Build-Depends:        base >= 4.9, base < 5, template-haskell, containers, mtl >= 2.2.1,
                         QuickCheck >= 2, HUnit, test-framework, test-framework-hunit,
                         test-framework-quickcheck2 >= 0.3, deepseq, transformers, th-expand-syns
 
   ghc-options:          -W -Wno-incomplete-patterns
-                        
+  Other-Modules:
+        Data.Comp
+        Data.Comp.Algebra
+        Data.Comp.Annotation
+        Data.Comp.Arbitrary
+        Data.Comp.Derive
+        Data.Comp.Derive.Arbitrary
+        Data.Comp.Derive.DeepSeq
+        Data.Comp.Derive.Equality
+        Data.Comp.Derive.Foldable
+        Data.Comp.Derive.HaskellStrict
+        Data.Comp.Derive.Ordering
+        Data.Comp.Derive.Show
+        Data.Comp.Derive.SmartAConstructors
+        Data.Comp.Derive.SmartConstructors
+        Data.Comp.Derive.Traversable
+        Data.Comp.Derive.Utils
+        Data.Comp.Desugar
+        Data.Comp.Equality
+        Data.Comp.Equality_Test
+        Data.Comp.Examples.Comp
+        Data.Comp.Examples.Multi
+        Data.Comp.Examples_Test
+        Data.Comp.Generic
+        Data.Comp.Mapping
+        Data.Comp.Multi
+        Data.Comp.Multi.Algebra
+        Data.Comp.Multi.Annotation
+        Data.Comp.Multi.Derive
+        Data.Comp.Multi.Derive.Equality
+        Data.Comp.Multi.Derive.HFoldable
+        Data.Comp.Multi.Derive.HFunctor
+        Data.Comp.Multi.Derive.HTraversable
+        Data.Comp.Multi.Derive.Ordering
+        Data.Comp.Multi.Derive.Show
+        Data.Comp.Multi.Derive.SmartAConstructors
+        Data.Comp.Multi.Derive.SmartConstructors
+        Data.Comp.Multi.Desugar
+        Data.Comp.Multi.Equality
+        Data.Comp.Multi.Generic
+        Data.Comp.Multi.HFoldable
+        Data.Comp.Multi.HFunctor
+        Data.Comp.Multi.HTraversable
+        Data.Comp.Multi.Mapping
+        Data.Comp.Multi.Ops
+        Data.Comp.Multi.Ordering
+        Data.Comp.Multi.Show
+        Data.Comp.Multi.Sum
+        Data.Comp.Multi.Term
+        Data.Comp.Multi.Variables
+        Data.Comp.Multi.Variables_Test
+        Data.Comp.Multi_Test
+        Data.Comp.Ops
+        Data.Comp.Ordering
+        Data.Comp.Show
+        Data.Comp.SubsumeCommon
+        Data.Comp.Subsume_Test
+        Data.Comp.Sum
+        Data.Comp.Term
+        Data.Comp.Thunk
+        Data.Comp.Variables
+        Data.Comp.Variables_Test
+        Data.Comp_Test
+        Examples.Common
+        Examples.Desugar
+        Examples.Eval
+        Examples.EvalM
+        Examples.Thunk
+        Examples.Multi.Common
+        Examples.Multi.Desugar
+        Examples.Multi.Eval
+        Examples.Multi.EvalI
+        Examples.Multi.EvalM
+        Test.Utils
+  Default-Language:     Haskell2010
+                          
 Benchmark algebra
   Type:                 exitcode-stdio-1.0
   Main-is:		Benchmark.hs
@@ -215,11 +291,54 @@
   ghc-options:          -W -O2
   -- Disable short-cut fusion rules in order to compare optimised and unoptimised code.
   cpp-options:          -DNO_RULES
-  Build-Depends:        base >= 4.7, base < 5, template-haskell, containers, mtl >= 2.2.1,
+  Build-Depends:        base >= 4.9, base < 5, template-haskell, containers, mtl >= 2.2.1,
                         QuickCheck >= 2, deepseq, criterion, random, uniplate, transformers,
                         th-expand-syns
-
-
+  Other-Modules:
+        Data.Comp
+        Data.Comp.Algebra
+        Data.Comp.Annotation
+        Data.Comp.Arbitrary
+        Data.Comp.DeepSeq
+        Data.Comp.Derive
+        Data.Comp.Derive.Arbitrary
+        Data.Comp.Derive.DeepSeq
+        Data.Comp.Derive.Equality
+        Data.Comp.Derive.Foldable
+        Data.Comp.Derive.HaskellStrict
+        Data.Comp.Derive.Ordering
+        Data.Comp.Derive.Show
+        Data.Comp.Derive.SmartAConstructors
+        Data.Comp.Derive.SmartConstructors
+        Data.Comp.Derive.Traversable
+        Data.Comp.Derive.Utils
+        Data.Comp.Equality
+        Data.Comp.Generic
+        Data.Comp.Mapping
+        Data.Comp.Ops
+        Data.Comp.Ordering
+        Data.Comp.Show
+        Data.Comp.SubsumeCommon
+        Data.Comp.Sum
+        Data.Comp.Term
+        Data.Comp.Thunk
+        Data.Comp.Variables
+        DataTypes
+        DataTypes.Comp
+        DataTypes.Standard
+        DataTypes.Transform
+        Functions.Comp
+        Functions.Comp.Desugar
+        Functions.Comp.Eval
+        Functions.Comp.FreeVars
+        Functions.Comp.Inference
+        Functions.Standard
+        Functions.Standard.Desugar
+        Functions.Standard.Eval
+        Functions.Standard.FreeVars
+        Functions.Standard.Inference
+  Default-Language:     Haskell2010
+        
 source-repository head
   type:     git
   location: https://github.com/pa-ba/compdata
diff --git a/examples/Examples/Simple.hs b/examples/Examples/Simple.hs
deleted file mode 100644
--- a/examples/Examples/Simple.hs
+++ /dev/null
@@ -1,20 +0,0 @@
-{-# LANGUAGE FlexibleInstances #-}
-{-# LANGUAGE TypeOperators #-}
-{-# LANGUAGE MultiParamTypeClasses #-}
-module Examples.Simple where
-
-import Data.Comp
-
-data Lambda t a = App a a | Abs (Maybe (Term t)) 
-data Arith a = Const Int
-
-
-data LambdaType a = Fun a a
-
-data IntType a = IntType
-
-type Type = LambdaType :+: IntType
-
-type Sig t = Lambda t :+: Arith
-
-
diff --git a/examples/Examples/Thunk.hs b/examples/Examples/Thunk.hs
--- a/examples/Examples/Thunk.hs
+++ b/examples/Examples/Thunk.hs
@@ -1,5 +1,6 @@
-{-# LANGUAGE TemplateHaskell, TypeOperators, MultiParamTypeClasses,
-  FlexibleInstances, FlexibleContexts, UndecidableInstances, ConstraintKinds #-}
+{-# LANGUAGE TemplateHaskell, TypeOperators, MultiParamTypeClasses, DeriveFunctor,
+  FlexibleInstances, FlexibleContexts, UndecidableInstances, ConstraintKinds,
+  CPP #-}
 --------------------------------------------------------------------------------
 -- |
 -- Module      :  Examples.Thunk
@@ -23,25 +24,30 @@
 import Data.Comp.Show()
 import Examples.Common hiding (Value(..), Sig, iConst, iPair)
 
+-- Control.Monad.Fail import is redundant since GHC 8.8.1
+#if !MIN_VERSION_base(4,13,0)
+import Control.Monad.Fail
+#endif
+
 -- Signature for values, strict pairs
-data Value a = Const Int | Pair !a !a
+data Value a = Const Int | Pair !a !a deriving Functor
 
 -- Signature for the simple expression language
 type Sig = Op :+: Value
 
 -- Derive boilerplate code using Template Haskell
-$(derive [makeFunctor, makeTraversable, makeFoldable,
+$(derive [makeTraversable, makeFoldable,
           makeEqF, makeShowF, smartConstructors, makeHaskellStrict]
          [''Value])
 
 -- Monadic term evaluation algebra
 class EvalT f m v where
-  evalAlgT :: Monad m => AlgT m f v
+  evalAlgT :: MonadFail m => AlgT m f v
 
 $(derive [liftSum] [''EvalT])
 
 -- Lift the monadic evaluation algebra to a monadic catamorphism
-evalT :: (Traversable v, Functor f, EvalT f m v, Monad m) => Term f -> m (Term v)
+evalT :: (Traversable v, Functor f, EvalT f m v, MonadFail m) => Term f -> m (Term v)
 evalT = nf . cata evalAlgT
 
 instance (Value :<: m :+: v) => EvalT Value m v where
@@ -71,12 +77,8 @@
                           return y
 
 
-{-instance Monad (Either String) where
-    Left msg >>= _ = Left msg
-    Right x >>= f = f x
-                      
-    return = Right
-    fail = Left-}
+instance MonadFail (Either String) where
+    fail = Left
 
 evalTEx :: Either String (Term Value)
 evalTEx = evalT (iSnd (iFst (iConst 5) `iPair` iConst 4) :: Term Sig)
diff --git a/src/Data/Comp/Thunk.hs b/src/Data/Comp/Thunk.hs
--- a/src/Data/Comp/Thunk.hs
+++ b/src/Data/Comp/Thunk.hs
@@ -1,4 +1,5 @@
 {-# LANGUAGE ConstraintKinds     #-}
+{-# LANGUAGE CPP                 #-}
 {-# LANGUAGE FlexibleContexts    #-}
 {-# LANGUAGE Rank2Types          #-}
 {-# LANGUAGE ScopedTypeVariables #-}
@@ -53,6 +54,11 @@
 import Control.Monad hiding (mapM, sequence)
 import Data.Traversable
 
+-- Control.Monad.Fail import is redundant since GHC 8.8.1
+#if !MIN_VERSION_base(4,13,0)
+import Control.Monad.Fail (MonadFail)
+#endif
+
 import Prelude hiding (foldl, foldl1, foldr, foldr1, mapM, sequence)
 
 
@@ -80,7 +86,7 @@
 -- 'whnf' and then projects the top-level signature to the desired
 -- subsignature. Failure to do the projection is signalled as a
 -- failure in the monad.
-whnfPr :: (Monad m, g :<: f) => TermT m f -> m (g (TermT m f))
+whnfPr :: (MonadFail m, g :<: f) => TermT m f -> m (g (TermT m f))
 whnfPr t = do res <- whnf t
               case proj res of
                 Just res' -> return res'
@@ -111,7 +117,7 @@
 -- | This function evaluates all thunks while simultaneously
 -- projecting the term to a smaller signature. Failure to do the
 -- projection is signalled as a failure in the monad as in 'whnfPr'.
-nfPr :: (Monad m, Traversable g, g :<: f) => TermT m f -> m (Term g)
+nfPr :: (MonadFail m, Traversable g, g :<: f) => TermT m f -> m (Term g)
 nfPr = liftM Term . mapM nfPr <=< whnfPr
 
 -- | This function inspects a term (using 'nf') according to the
