diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,10 @@
 # Revision history for deep-transformations
 
+## 0.4.0.1 -- 2025-11-09
+
+* Presenting the `doctests` component as a testsuite to Cabal instead of a sublibrary because of issues with Haddock
+* Removed `doctest` from dependencies
+
 ## 0.4 -- 2025-10-26
 
 ### **BREAKING**
diff --git a/README.md b/README.md
--- a/README.md
+++ b/README.md
@@ -21,7 +21,6 @@
 ~~~ {.haskell}
 {-# LANGUAGE FlexibleContexts, FlexibleInstances, MultiParamTypeClasses,
              StandaloneDeriving, TypeFamilies, TypeOperators, UndecidableInstances #-}
-module README where
 ~~~
 
 It will also require several imports.
@@ -472,3 +471,11 @@
 -- >>> Full.fmap ConstantFold $ Identity $ AG.syn s
 -- Identity (Con 2905)
 ~~~
+
+<!-- This block should be executable but not part of documentation
+
+~~~ {.haskell}
+main = putStrLn "To test, run: cabal repl --with-ghc=doctest deep-transformations:doctests"
+~~~
+
+-->
diff --git a/deep-transformations.cabal b/deep-transformations.cabal
--- a/deep-transformations.cabal
+++ b/deep-transformations.cabal
@@ -2,7 +2,7 @@
 -- documentation, see http://haskell.org/cabal/users-guide/
 
 name:                deep-transformations
-version:             0.4
+version:             0.4.0.1
 synopsis:            Deep natural and unnatural tree transformations, including attribute grammars
 description:
 
@@ -43,11 +43,13 @@
                         template-haskell >= 2.11 && < 2.24, generic-lens >= 1.2 && < 2.4
   default-language:     Haskell2010
 
-library doctests
+test-suite doctests
+  type: exitcode-stdio-1.0
+  main-is:             README.lhs
   hs-source-dirs:      test
   default-language:    Haskell2010
   default-extensions:  FlexibleInstances, MultiParamTypeClasses, TypeFamilies, TypeOperators
-  other-modules:       README, RepMin, RepMinAuto, RepMinKeepAG
+  other-modules:       RepMin, RepMinAuto, RepMinKeepAG
   ghc-options:         -threaded -pgmL markdown-unlit
   build-depends:       base, rank2classes, deep-transformations
-  build-tool-depends:  markdown-unlit:markdown-unlit >= 0.5 && < 0.6, doctest:doctest >= 0.8 && < 1
+  build-tool-depends:  markdown-unlit:markdown-unlit >= 0.5 && < 0.6
diff --git a/test/README.lhs b/test/README.lhs
--- a/test/README.lhs
+++ b/test/README.lhs
@@ -21,7 +21,6 @@
 ~~~ {.haskell}
 {-# LANGUAGE FlexibleContexts, FlexibleInstances, MultiParamTypeClasses,
              StandaloneDeriving, TypeFamilies, TypeOperators, UndecidableInstances #-}
-module README where
 ~~~
 
 It will also require several imports.
@@ -472,3 +471,11 @@
 -- >>> Full.fmap ConstantFold $ Identity $ AG.syn s
 -- Identity (Con 2905)
 ~~~
+
+<!-- This block should be executable but not part of documentation
+
+~~~ {.haskell}
+main = putStrLn "To test, run: cabal repl --with-ghc=doctest deep-transformations:doctests"
+~~~
+
+-->
