diff --git a/CHANGELOG b/CHANGELOG
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,22 @@
+1.23.1 --> 1.24.0
+=================
+* Support ImportQualifiedPost (#477)
+  - Technically breaking change: KnownExtension gained a new constructor ImportQualifiedPost
+* Fix pretty printing of promoted list/tuple with space padding (#423)
+* Fix lexing of operator symbols like @: when TypeApplications is enabled (#430)
+* Read files strictly before closing to prevent resource leaks (#460)
+* Add Safe Haskell annotations to many modules (#465)
+* Remove noncanonical return and mappend definitions (#481)
+* Solve some compiler warnings (#464)
+* Performance optimization: use strict accumulators in lexString and parseInteger (#479)
+
+
+1.23.0 --> 1.23.1
+=================
+* show instance for SrcLoc and SrcSpan renders "(-1)" instead of "-1"
+* Allow empty closed type families (#452)
+
+
 1.22.0 --> 1.23.0
 =================
 * Add support for BlockArguments (#444)
diff --git a/haskell-src-exts.cabal b/haskell-src-exts.cabal
--- a/haskell-src-exts.cabal
+++ b/haskell-src-exts.cabal
@@ -1,5 +1,5 @@
 Name:                   haskell-src-exts
-Version:                1.23.1
+Version:                1.24.0
 License:                BSD3
 License-File:           LICENSE
 Build-Type:             Simple
@@ -18,15 +18,7 @@
 Bug-Reports:            https://github.com/haskell-suite/haskell-src-exts/issues
 Stability:              Stable
 Cabal-Version:          >= 1.10
-Tested-With:
-                          GHC == 7.8.2
-                        , GHC == 7.10.3
-                        , GHC == 8.0.2
-                        , GHC == 8.2.2
-                        , GHC == 8.4.4
-                        , GHC == 8.6.5
-                        , GHC == 8.8.3
-                        , GHC == 8.10.1
+Tested-With:            GHC == 9.14.1
 
 Extra-Source-Files:
                         README.md
@@ -48,15 +40,16 @@
 Library
   Default-language:     Haskell98
   Build-Tools:          happy >= 1.19
-  Build-Depends:        array >= 0.1, pretty >= 1.0,
+  Build-Depends:        array >= 0.1 && < 0.6,
+                        pretty >= 1.0 && < 1.2,
                         base >= 4.5 && < 5,
                         -- this is needed to access GHC.Generics on GHC 7.4
-                        ghc-prim
+                        ghc-prim < 0.14
   -- this is needed to access Data.Semigroup and Control.Monad.Fail on GHCs
   -- before 8.0
   if !impl(ghc >= 8.0)
     Build-Depends:
-                        semigroups >= 0.18.3,
+                        semigroups >= 0.18.3 && < 0.21,
                         fail == 4.9.*
 
   Exposed-modules:      Language.Haskell.Exts,
diff --git a/src/Language/Haskell/Exts.hs b/src/Language/Haskell/Exts.hs
--- a/src/Language/Haskell/Exts.hs
+++ b/src/Language/Haskell/Exts.hs
@@ -160,7 +160,9 @@
 readUTF8File fp = do
   h <- openFile fp ReadMode
   hSetEncoding h utf8
-  hGetContents h
+  c <- hGetContents h >>= \s -> length s `seq` return s
+  hClose h
+  return c
 
 -- | Converts a parse result with comments to a parse result with comments and
 --   unknown pragmas.
diff --git a/src/Language/Haskell/Exts/Build.hs b/src/Language/Haskell/Exts/Build.hs
--- a/src/Language/Haskell/Exts/Build.hs
+++ b/src/Language/Haskell/Exts/Build.hs
@@ -1,3 +1,5 @@
+{-# LANGUAGE Safe #-}
+
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  Language.Haskell.Exts.Build
diff --git a/src/Language/Haskell/Exts/Comments.hs b/src/Language/Haskell/Exts/Comments.hs
--- a/src/Language/Haskell/Exts/Comments.hs
+++ b/src/Language/Haskell/Exts/Comments.hs
@@ -1,4 +1,5 @@
-{-# LANGUAGE DeriveDataTypeable #-}
+{-# LANGUAGE DeriveDataTypeable, Safe #-}
+
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  Language.Haskell.Exts.Comments
diff --git a/src/Language/Haskell/Exts/ExactPrint.hs b/src/Language/Haskell/Exts/ExactPrint.hs
--- a/src/Language/Haskell/Exts/ExactPrint.hs
+++ b/src/Language/Haskell/Exts/ExactPrint.hs
@@ -1,5 +1,5 @@
-{-# LANGUAGE DeriveFunctor #-}
-{-# LANGUAGE CPP #-}
+{-# LANGUAGE CPP, DeriveFunctor, Safe #-}
+
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  Language.Haskell.Exts.Annotated.ExactPrint
@@ -47,11 +47,10 @@
   fmap = liftM
 
 instance Applicative EP where
-  pure = return
+  pure x = EP $ \l cs -> (x, l, cs, id)
   (<*>) = ap
 
 instance Monad EP where
-  return x = EP $ \l cs -> (x, l, cs, id)
 
   EP m >>= k = EP $ \l0 c0 -> let
         (a, l1, c1, s1) = m l0 c0
@@ -414,13 +413,18 @@
                      return pts'
                   _ -> errorEP "ExactP: ImportDecl is given too few srcInfoPoints"
                 else return pts1
-        pts3 <- if qf then
-                 case pts2 of
-                  x:pts' -> do
+
+        -- Try to determine if qualified is post-positioned only if we have enough points
+        let isPostQual = (qf && not (null pts2)) && safeIsPostQualified pts2
+
+        pts3 <- if qf && not isPostQual then
+                  case pts2 of
+                   x:pts' -> do
                      printStringAt (pos x) "qualified"
                      return pts'
-                  _ -> errorEP "ExactP: ImportDecl is given too few srcInfoPoints"
+                   _ -> errorEP "ExactP: ImportDecl is given too few srcInfoPoints"
                 else return pts2
+
         pts4 <- case mpkg of
                 Just pkg ->
                   case pts3 of
@@ -429,20 +433,44 @@
                       return pts'
                    _ -> errorEP "ExactP: ImportDecl is given too few srcInfoPoints"
                 _ -> return pts3
+
         exactPC mn
-        _ <- case mas of
-                Just as ->
+
+        -- Only try post-qualified if we determined it's actually post-qualified
+        pts5 <- if qf && isPostQual then
                  case pts4 of
                   x:pts' -> do
+                     printStringAt (pos x) "qualified"
+                     return pts'
+                  _ -> errorEP "ExactP: ImportDecl is given too few srcInfoPoints"
+                else return pts4
+
+        _ <- case mas of
+               Just as ->
+                 case pts5 of
+                   x:pts' -> do
                      printStringAt (pos x) "as"
                      exactPC as
                      return pts'
-                  _ -> errorEP "ExactP: ImportDecl is given too few srcInfoPoints"
-                _ -> return pts4
+                   _ -> errorEP "ExactP: ImportDecl is given too few srcInfoPoints"
+               _ -> return pts5
+
         case mispecs of
          Nothing -> return ()
          Just ispecs -> exactPC ispecs
      _ -> errorEP "ExactP: ImportDecl is given too few srcInfoPoints"
+    where safeIsPostQualified pts =
+            case pts of
+              (p:_) ->
+                let modSpan = srcInfoSpan (ann mn)
+                    -- Only consider it post-qualified if we have valid spans to compare
+                in ((isValidSpan modSpan && isValidSpan p) &&
+                    (srcSpanEnd modSpan <= srcSpanStart p))
+              _ -> False
+            where
+              isValidSpan s =
+                srcSpanStartLine s > 0 && srcSpanEndLine s > 0 &&
+                srcSpanStartColumn s >= 0 && srcSpanEndColumn s >= 0
 
 instance ExactP Module where
   exactP mdl = case mdl of
diff --git a/src/Language/Haskell/Exts/ExtScheme.hs b/src/Language/Haskell/Exts/ExtScheme.hs
--- a/src/Language/Haskell/Exts/ExtScheme.hs
+++ b/src/Language/Haskell/Exts/ExtScheme.hs
@@ -1,4 +1,6 @@
+{-# LANGUAGE Safe #-}
 {-# OPTIONS_HADDOCK hide #-}
+
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  Language.Haskell.Exts.ExtScheme
diff --git a/src/Language/Haskell/Exts/Extension.hs b/src/Language/Haskell/Exts/Extension.hs
--- a/src/Language/Haskell/Exts/Extension.hs
+++ b/src/Language/Haskell/Exts/Extension.hs
@@ -1,5 +1,5 @@
-{-# LANGUAGE DeriveDataTypeable #-}
-{-# LANGUAGE CPP #-}
+{-# LANGUAGE CPP, DeriveDataTypeable, Safe #-}
+
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  Language.Haskell.Exts.Extension
@@ -374,6 +374,8 @@
   --
   -- > import "network" Network.Socket
   | PackageImports
+
+  | ImportQualifiedPost
 
   | LambdaCase
 
diff --git a/src/Language/Haskell/Exts/Fixity.hs b/src/Language/Haskell/Exts/Fixity.hs
--- a/src/Language/Haskell/Exts/Fixity.hs
+++ b/src/Language/Haskell/Exts/Fixity.hs
@@ -1,5 +1,5 @@
-{-# LANGUAGE DeriveDataTypeable #-}
-{-# LANGUAGE CPP #-}
+{-# LANGUAGE CPP, DeriveDataTypeable, Safe #-}
+
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  Language.Haskell.Exts.Fixity
diff --git a/src/Language/Haskell/Exts/InternalLexer.hs b/src/Language/Haskell/Exts/InternalLexer.hs
--- a/src/Language/Haskell/Exts/InternalLexer.hs
+++ b/src/Language/Haskell/Exts/InternalLexer.hs
@@ -1,4 +1,7 @@
+{-# LANGUAGE Safe #-}
+{-# LANGUAGE BangPatterns #-}
 {-# OPTIONS_HADDOCK hide #-}
+
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  Language.Haskell.Exts.Annotated.InternalLexer
@@ -378,8 +381,9 @@
 -- Used in the lexing of type applications
 -- Why is it like this? I don't know exactly but this is how it is in
 -- GHC's parser.
+-- Symbol `:` is added so that `@:` is lexed as `VarSym "@:"`. See Issue #326
 isOpSymbol :: Char -> Bool
-isOpSymbol c = c `elem` "!#$%&*+./<=>?@\\^|-~"
+isOpSymbol c = c `elem` ":!#$%&*+./<=>?@\\^|-~"
 
 -- | Checks whether the character would be legal in some position of a qvar.
 --   Means that '..' and "AAA" will pass the test.
@@ -1143,23 +1147,23 @@
 
 
 lexString :: Lex a Token
-lexString = loop ("","")
+lexString = loop [] []
     where
-    loop (s,raw) = do
+    loop !s !raw = do
         r <- getInput
         exts <- getExtensionsL
         case r of
             '\\':'&':_ -> do
                     discard 2
-                    loop (s, '&':'\\':raw)
+                    loop s ('&':'\\':raw)
             '\\':c:_ | isSpace c -> do
                         discard 1
                         wcs <- lexWhiteChars
                         matchChar '\\' "Illegal character in string gap"
-                        loop (s, '\\':reverse wcs ++ '\\':raw)
+                        loop s ('\\':revAppend wcs ('\\':raw))
                      | otherwise -> do
                         (ce, str) <- lexEscape
-                        loop (ce:s, reverse str ++ '\\':raw)
+                        loop (ce `seq` ce : s) (revAppend str ('\\':raw))
             '"':'#':_ | MagicHash `elem` exts -> do
                         discard 2
                         return (StringHash (reverse s, reverse raw))
@@ -1168,9 +1172,13 @@
                 return (StringTok (reverse s, reverse raw))
             c:_ | c /= '\n' -> do
                 discard 1
-                loop (c:s, c:raw)
+                loop (c:s) (c:raw)
             _ ->   fail "Improperly terminated string"
 
+    revAppend :: [a] -> [a] -> [a]
+    revAppend []     ys = ys
+    revAppend (x:xs) ys = revAppend xs (x:ys)
+
     lexWhiteChars :: Lex a String
     lexWhiteChars = do
         s <- getInput
@@ -1301,8 +1309,10 @@
 
 -- Stolen from Hugs's Prelude
 parseInteger :: Integer -> String -> Integer
-parseInteger radix ds =
-    foldl1 (\n d -> n * radix + d) (map (toInteger . digitToInt) ds)
+parseInteger radix = go 0
+  where
+    go !acc []     = acc
+    go !acc (d:ds) = go (acc * radix + toInteger (digitToInt d)) ds
 
 flagKW :: Token -> Lex a ()
 flagKW t =
diff --git a/src/Language/Haskell/Exts/InternalParser.ly b/src/Language/Haskell/Exts/InternalParser.ly
--- a/src/Language/Haskell/Exts/InternalParser.ly
+++ b/src/Language/Haskell/Exts/InternalParser.ly
@@ -1,6 +1,7 @@
 > {
 > {-# LANGUAGE CPP #-}
 > {-# OPTIONS_HADDOCK hide #-}
+> 
 > -----------------------------------------------------------------------------
 > -- |
 > -- Module      :  Language.Haskell.Exts.Annotated.Parser
@@ -465,10 +466,10 @@
 >       | impdecl                               { ([$1],[]) }
 
 > impdecl :: { ImportDecl L }
->       : 'import' optsrc optsafe optqualified maybepkg modid maybeas maybeimpspec
->                               { let { (mmn,ss,ml) = $7 ;
->                                       l = nIS $1 <++> ann $6 <+?> ml <+?> (fmap ann) $8 <** ($1:snd $2 ++ snd $3 ++ snd $4 ++ snd $5 ++ ss)}
->                                  in ImportDecl l $6 (fst $4) (fst $2) (fst $3) (fst $5) mmn $8 }
+>       : 'import' optsrc optsafe optqualified maybepkg modid optqualified_post maybeas maybeimpspec
+>                               { let { (mmn,ss,ml) = $8 ;
+>                                       l = nIS $1 <++> ann $6 <+?> ml <+?> (fmap ann) $9 <** ($1:snd $2 ++ snd $3 ++ snd $4 ++ snd $5 ++ snd $7 ++ ss)}
+>                                  in ImportDecl l $6 (fst $4 || fst $7) (fst $2) (fst $3) (fst $5) mmn $9 }
 
 > optsrc :: { (Bool,[S]) }
 >       : '{-# SOURCE' '#-}'                    { (True,[$1,$2]) }
@@ -481,6 +482,11 @@
 
 > optqualified :: { (Bool,[S]) }
 >       : 'qualified'                           { (True,[$1]) }
+>       | {- empty -}                           { (False, []) }
+
+> optqualified_post :: { (Bool,[S]) }
+>       : 'qualified'                           {% do { checkEnabled ImportQualifiedPost;
+>                                                       return (True,[$1]) } }
 >       | {- empty -}                           { (False, []) }
 
 Requires the PackageImports extension enabled.
diff --git a/src/Language/Haskell/Exts/Lexer.hs b/src/Language/Haskell/Exts/Lexer.hs
--- a/src/Language/Haskell/Exts/Lexer.hs
+++ b/src/Language/Haskell/Exts/Lexer.hs
@@ -1,3 +1,5 @@
+{-# LANGUAGE Safe #-}
+
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  Language.Haskell.Exts.Lexer
diff --git a/src/Language/Haskell/Exts/ParseMonad.hs b/src/Language/Haskell/Exts/ParseMonad.hs
--- a/src/Language/Haskell/Exts/ParseMonad.hs
+++ b/src/Language/Haskell/Exts/ParseMonad.hs
@@ -1,5 +1,6 @@
-{-# LANGUAGE CPP #-}
+{-# LANGUAGE CPP, Safe #-}
 {-# OPTIONS_HADDOCK hide #-}
+
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  Language.Haskell.Exts.ParseMonad
@@ -98,7 +99,6 @@
   ParseFailed loc msg <*> _ = ParseFailed loc msg
 
 instance Monad ParseResult where
-  return = ParseOk
 #if !MIN_VERSION_base(4,13,0)
   fail = Fail.fail
 #endif
@@ -114,7 +114,6 @@
 
 instance ( Monoid m , Semigroup m) => Monoid (ParseResult m) where
   mempty = ParseOk mempty
-  mappend = (<>)
 
 -- internal version
 data ParseStatus a = Ok ParseState a | Failed SrcLoc String
@@ -242,11 +241,10 @@
   fmap = liftM
 
 instance Applicative P where
-  pure = return
+  pure a = P $ \_i _x _y _l _ch s _m -> Ok s a
   (<*>) = ap
 
 instance Monad P where
-    return a = P $ \_i _x _y _l _ch s _m -> Ok s a
     P m >>= k = P $ \i x y l ch s mode ->
         case m i x y l ch s mode of
             Failed loc msg -> Failed loc msg
@@ -354,11 +352,10 @@
     fmap = liftM
 
 instance Applicative (Lex r) where
-    pure = return
+    pure a = Lex $ \k -> k a
     (<*>) = ap
 
 instance Monad (Lex r) where
-    return a = Lex $ \k -> k a
     Lex v >>= f = Lex $ \k -> v (\a -> runL (f a) k)
     Lex v >> Lex w = Lex $ \k -> v (\_ -> w k)
 #if !MIN_VERSION_base(4,13,0)
diff --git a/src/Language/Haskell/Exts/Parser.hs b/src/Language/Haskell/Exts/Parser.hs
--- a/src/Language/Haskell/Exts/Parser.hs
+++ b/src/Language/Haskell/Exts/Parser.hs
@@ -1,5 +1,6 @@
 {-# LANGUAGE CPP, DeriveDataTypeable, FlexibleInstances, DeriveFunctor #-}
 {-# OPTIONS_GHC -fno-warn-orphans #-}
+
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  Language.Haskell.Exts.Annotated.Parser
diff --git a/src/Language/Haskell/Exts/Pretty.hs b/src/Language/Haskell/Exts/Pretty.hs
--- a/src/Language/Haskell/Exts/Pretty.hs
+++ b/src/Language/Haskell/Exts/Pretty.hs
@@ -117,7 +117,6 @@
 instance Monad (DocM s) where
         (>>=) = thenDocM
         (>>) = then_DocM
-        return = retDocM
 
 {-# INLINE thenDocM #-}
 {-# INLINE then_DocM #-}
@@ -894,13 +893,24 @@
       PromotedCon _ hasQuote qn ->
         addQuote hasQuote (pretty qn)
       PromotedList _ hasQuote list ->
-        addQuote hasQuote $ bracketList . punctuate comma . map pretty $ list
+        addQuote hasQuote $ brackets . addSpace list . prettyList $ list
       PromotedTuple _ list ->
-        addQuote True $ parenList $ map pretty list
+        addQuote True $ parens . addSpace list . prettyList $ list
       PromotedUnit {} -> addQuote True $ text "()"
     where
       addQuote True doc = char '\'' <> doc
       addQuote False doc = doc
+
+      checkQuote (PromotedCon _ q _) = q
+      checkQuote (PromotedList _ q _) = q
+      checkQuote (PromotedTuple _ _) = True
+      checkQuote _ = False
+
+      addSpace (TyPromoted _ l0:_) | checkQuote l0 = (space <>)
+      addSpace _ = id
+
+      prettyList = myFsepSimple . punctuate comma . map pretty
+
 
 instance  Pretty (TyVarBind l) where
         pretty (KindedVar _ var kind) = parens $ myFsep [pretty var, text "::", pretty kind]
diff --git a/src/Language/Preprocessor/Unlit.hs b/src/Language/Preprocessor/Unlit.hs
--- a/src/Language/Preprocessor/Unlit.hs
+++ b/src/Language/Preprocessor/Unlit.hs
@@ -14,17 +14,17 @@
 classify (('\\':x):xs) | x == "begin{code}" = Blank : allProg xs
    where allProg [] = []  -- Should give an error message,
                           -- but I have no good position information.
-         allProg (('\\':x):xs) |  "end{code}"`isPrefixOf`x = Blank : classify xs
-         allProg (x:xs) = Program x:allProg xs
-classify (('>':x):xs)      = Program (' ':x) : classify xs
+         allProg (('\\':y):ys) |  "end{code}" `isPrefixOf` y = Blank : classify ys
+         allProg (y:ys) = Program y : allProg ys
+classify (('>':x):xs)      = Program (' ' : x) : classify xs
 classify (('#':x):xs)      = (case words x of
                                 (line:rest) | all isDigit line
                                    -> Include (read line) (unwords rest)
                                 _  -> Pre x
                              ) : classify xs
 --classify (x:xs) | "{-# LINE" `isPrefixOf` x = Program x: classify xs
-classify (x:xs) | all isSpace x = Blank:classify xs
-classify (x:xs)                 = Comment:classify xs
+classify (x:xs) | all isSpace x = Blank : classify xs
+classify (_:xs)                 = Comment : classify xs
 
 unclassify :: Classified -> String
 unclassify (Program s) = s
@@ -43,16 +43,16 @@
 
 adjacent :: FilePath -> Int -> Classified -> [Classified] -> [Classified]
 adjacent file 0 _             (x              :xs) = x : adjacent file 1 x xs -- force evaluation of line number
-adjacent file n y@(Program _) (x@Comment      :xs) = error (message file n "program" "comment")
-adjacent file n y@(Program _) (x@(Include i f):xs) = x: adjacent f    i     y xs
+adjacent file n   (Program _) (Comment        :_ ) = error (message file n "program" "comment")
+adjacent _    _ y@(Program _) (x@(Include i f):xs) = x: adjacent f    i     y xs
 adjacent file n y@(Program _) (x@(Pre _)      :xs) = x: adjacent file (n+1) y xs
-adjacent file n y@Comment     (x@(Program _)  :xs) = error (message file n "comment" "program")
-adjacent file n y@Comment     (x@(Include i f):xs) = x: adjacent f    i     y xs
+adjacent file n   Comment     (  (Program _)  :_ ) = error (message file n "comment" "program")
+adjacent _    _ y@Comment     (x@(Include i f):xs) = x: adjacent f    i     y xs
 adjacent file n y@Comment     (x@(Pre _)      :xs) = x: adjacent file (n+1) y xs
-adjacent file n y@Blank       (x@(Include i f):xs) = x: adjacent f    i     y xs
+adjacent _    _ y@Blank       (x@(Include i f):xs) = x: adjacent f    i     y xs
 adjacent file n y@Blank       (x@(Pre _)      :xs) = x: adjacent file (n+1) y xs
-adjacent file n _             (x@next         :xs) = x: adjacent file (n+1) x xs
-adjacent file n _             []                   = []
+adjacent file n _             (x              :xs) = x: adjacent file (n+1) x xs
+adjacent _    _ _             []                   = []
 
 message :: String -> Int -> String -> String -> String
 message "\"\"" n p c = "Line "++show n++": "++p++ " line before "++c++" line.\n"
@@ -63,7 +63,7 @@
 -- Re-implementation of 'lines', for better efficiency (but decreased laziness).
 -- Also, importantly, accepts non-standard DOS and Mac line ending characters.
 inlines :: String -> [String]
-inlines s = lines' s id
+inlines = (`lines'` id)
   where
   lines' []             acc = [acc []]
   lines' ('\^M':'\n':s) acc = acc [] : lines' s id      -- DOS
diff --git a/tests/Extensions.hs b/tests/Extensions.hs
--- a/tests/Extensions.hs
+++ b/tests/Extensions.hs
@@ -22,12 +22,30 @@
 (~~) :: Monad m => [Extension] -> [Extension] -> Property m
 xts1 ~~ xts2 = forAll $ \lang -> ((==) `on` sort . toExtensionList lang) xts1 xts2
 
+-- arbitrary examples
+e1 :: KnownExtension
+e1 = OverlappingInstances
+
+e2 :: KnownExtension
+e2 = UndecidableInstances
+
 extensionProperties :: TestTree
 extensionProperties =
   localOption (SmallCheckDepth 2) $ testGroup "Properties of LANGUAGE extensions" $
   [ testProperty "identity" $ \x -> x ~~ x
   , testProperty "idempotence" $ \x -> x ++ x ~~ x
-  , testProperty "right bias" $ \x y -> x ++ y ++ x ~~ y ++ x
+  -- Actually, let's not exhaustively check n^2 cases
+  -- , testProperty "right bias" $ \x y -> x ++ y ++ x ~~ y ++ x
+  , testProperty "right bias - override to disabled" $
+      [EnableExtension e1, DisableExtension e1] ~~ [DisableExtension e1]
+  , testProperty "right bias - override to enabled" $
+      [DisableExtension e1, EnableExtension e1] ~~ [EnableExtension e1]
+  , testProperty "right bias - interleaved override to disabled" $
+      [EnableExtension e1, EnableExtension e2, DisableExtension e1]
+        ~~ [EnableExtension e2, DisableExtension e1]
+  , testProperty "right bias - interleaved override to enabled" $
+      [DisableExtension e1, EnableExtension e2, EnableExtension e1]
+        ~~ [EnableExtension e2, EnableExtension e1]
   , testProperty "closedness of implication" $ \x -> impliesExts (impliesExts x) == impliesExts x
   , testProperty "closedness of toExtensionList" $ \l x -> let es = toExtensionList l x in es == impliesExts es
   , testProperty "opposite extensions 1" $ \x -> [EnableExtension x, DisableExtension x] ~~ [DisableExtension x]
diff --git a/tests/Runner.hs b/tests/Runner.hs
--- a/tests/Runner.hs
+++ b/tests/Runner.hs
@@ -180,7 +180,9 @@
 readUTF8File :: FilePath -> IO String
 readUTF8File fp = openFile fp ReadMode >>= \h -> do
         hSetEncoding h utf8
-        hGetContents h
+        c <- hGetContents h >>= \s -> length s `seq` return s
+        hClose h
+        return c
 
 parseUTF8FileWithComments :: ParseMode -> FilePath -> IO (ParseResult (Module SrcSpanInfo, [Comment]))
 parseUTF8FileWithComments p fp = readUTF8File fp >>= (return . parseFileContentsWithComments p)
diff --git a/tests/examples/ImportQualifiedPost.hs b/tests/examples/ImportQualifiedPost.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/ImportQualifiedPost.hs
@@ -0,0 +1,4 @@
+{-# LANGUAGE ImportQualifiedPost #-}
+module ImportQualifiedPost where
+
+import Data.List qualified as L
diff --git a/tests/examples/ImportQualifiedPost.hs.exactprinter.golden b/tests/examples/ImportQualifiedPost.hs.exactprinter.golden
new file mode 100644
--- /dev/null
+++ b/tests/examples/ImportQualifiedPost.hs.exactprinter.golden
@@ -0,0 +1,1 @@
+Match
diff --git a/tests/examples/ImportQualifiedPost.hs.parser.golden b/tests/examples/ImportQualifiedPost.hs.parser.golden
new file mode 100644
--- /dev/null
+++ b/tests/examples/ImportQualifiedPost.hs.parser.golden
@@ -0,0 +1,89 @@
+ParseOk
+  ( Module
+      SrcSpanInfo
+        { srcInfoSpan =
+            SrcSpan "tests/examples/ImportQualifiedPost.hs" 1 1 5 1
+        , srcInfoPoints =
+            [ SrcSpan "tests/examples/ImportQualifiedPost.hs" 1 1 1 1
+            , SrcSpan "tests/examples/ImportQualifiedPost.hs" 2 1 2 1
+            , SrcSpan "tests/examples/ImportQualifiedPost.hs" 2 1 2 1
+            , SrcSpan "tests/examples/ImportQualifiedPost.hs" 4 1 4 1
+            , SrcSpan "tests/examples/ImportQualifiedPost.hs" 5 1 5 1
+            , SrcSpan "tests/examples/ImportQualifiedPost.hs" 5 1 5 1
+            ]
+        }
+      (Just
+         (ModuleHead
+            SrcSpanInfo
+              { srcInfoSpan =
+                  SrcSpan "tests/examples/ImportQualifiedPost.hs" 2 1 2 33
+              , srcInfoPoints =
+                  [ SrcSpan "tests/examples/ImportQualifiedPost.hs" 2 1 2 7
+                  , SrcSpan "tests/examples/ImportQualifiedPost.hs" 2 28 2 33
+                  ]
+              }
+            (ModuleName
+               SrcSpanInfo
+                 { srcInfoSpan =
+                     SrcSpan "tests/examples/ImportQualifiedPost.hs" 2 8 2 27
+                 , srcInfoPoints = []
+                 }
+               "ImportQualifiedPost")
+            Nothing
+            Nothing))
+      [ LanguagePragma
+          SrcSpanInfo
+            { srcInfoSpan =
+                SrcSpan "tests/examples/ImportQualifiedPost.hs" 1 1 1 37
+            , srcInfoPoints =
+                [ SrcSpan "tests/examples/ImportQualifiedPost.hs" 1 1 1 13
+                , SrcSpan "tests/examples/ImportQualifiedPost.hs" 1 34 1 37
+                ]
+            }
+          [ Ident
+              SrcSpanInfo
+                { srcInfoSpan =
+                    SrcSpan "tests/examples/ImportQualifiedPost.hs" 1 14 1 33
+                , srcInfoPoints = []
+                }
+              "ImportQualifiedPost"
+          ]
+      ]
+      [ ImportDecl
+          { importAnn =
+              SrcSpanInfo
+                { srcInfoSpan =
+                    SrcSpan "tests/examples/ImportQualifiedPost.hs" 4 1 4 32
+                , srcInfoPoints =
+                    [ SrcSpan "tests/examples/ImportQualifiedPost.hs" 4 1 4 7
+                    , SrcSpan "tests/examples/ImportQualifiedPost.hs" 4 18 4 27
+                    , SrcSpan "tests/examples/ImportQualifiedPost.hs" 4 28 4 30
+                    ]
+                }
+          , importModule =
+              ModuleName
+                SrcSpanInfo
+                  { srcInfoSpan =
+                      SrcSpan "tests/examples/ImportQualifiedPost.hs" 4 8 4 17
+                  , srcInfoPoints = []
+                  }
+                "Data.List"
+          , importQualified = True
+          , importSrc = False
+          , importSafe = False
+          , importPkg = Nothing
+          , importAs =
+              Just
+                (ModuleName
+                   SrcSpanInfo
+                     { srcInfoSpan =
+                         SrcSpan "tests/examples/ImportQualifiedPost.hs" 4 31 4 32
+                     , srcInfoPoints = []
+                     }
+                   "L")
+          , importSpecs = Nothing
+          }
+      ]
+      []
+  , []
+  )
diff --git a/tests/examples/ImportQualifiedPost.hs.prettyparser.golden b/tests/examples/ImportQualifiedPost.hs.prettyparser.golden
new file mode 100644
--- /dev/null
+++ b/tests/examples/ImportQualifiedPost.hs.prettyparser.golden
@@ -0,0 +1,1 @@
+Match
diff --git a/tests/examples/ImportQualifiedPost.hs.prettyprinter.golden b/tests/examples/ImportQualifiedPost.hs.prettyprinter.golden
new file mode 100644
--- /dev/null
+++ b/tests/examples/ImportQualifiedPost.hs.prettyprinter.golden
@@ -0,0 +1,3 @@
+{-# LANGUAGE ImportQualifiedPost #-}
+module ImportQualifiedPost where
+import qualified Data.List as L
diff --git a/tests/examples/PromotedSpace.hs b/tests/examples/PromotedSpace.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/PromotedSpace.hs
@@ -0,0 +1,20 @@
+{-# LANGUAGE DataKinds #-}
+module PromotedSpace where
+
+-- Promoted list containing promoted constructor with quote
+type PL1 = '[ 'True ]
+
+-- Promoted list containing promoted list
+type PL2 = '[ '[Int] ]
+
+-- Promoted list containing promoted tuple
+type PL3 = '[ '(Int, Bool) ]
+
+-- Promoted tuple containing promoted constructor with quote
+type PT1 = '( 'True, False )
+
+-- Promoted tuple containing promoted list
+type PT2 = '( '[Int], Bool )
+
+-- Promoted tuple containing promoted tuple
+type PT3 = '( '(Int, Bool), Char )
diff --git a/tests/examples/PromotedSpace.hs.exactprinter.golden b/tests/examples/PromotedSpace.hs.exactprinter.golden
new file mode 100644
--- /dev/null
+++ b/tests/examples/PromotedSpace.hs.exactprinter.golden
@@ -0,0 +1,1 @@
+Match
diff --git a/tests/examples/PromotedSpace.hs.parser.golden b/tests/examples/PromotedSpace.hs.parser.golden
new file mode 100644
--- /dev/null
+++ b/tests/examples/PromotedSpace.hs.parser.golden
@@ -0,0 +1,617 @@
+ParseOk
+  ( Module
+      SrcSpanInfo
+        { srcInfoSpan = SrcSpan "tests/examples/PromotedSpace.hs" 1 1 21 1
+        , srcInfoPoints =
+            [ SrcSpan "tests/examples/PromotedSpace.hs" 1 1 1 1
+            , SrcSpan "tests/examples/PromotedSpace.hs" 2 1 2 1
+            , SrcSpan "tests/examples/PromotedSpace.hs" 2 1 2 1
+            , SrcSpan "tests/examples/PromotedSpace.hs" 5 1 5 1
+            , SrcSpan "tests/examples/PromotedSpace.hs" 8 1 8 1
+            , SrcSpan "tests/examples/PromotedSpace.hs" 11 1 11 1
+            , SrcSpan "tests/examples/PromotedSpace.hs" 14 1 14 1
+            , SrcSpan "tests/examples/PromotedSpace.hs" 17 1 17 1
+            , SrcSpan "tests/examples/PromotedSpace.hs" 20 1 20 1
+            , SrcSpan "tests/examples/PromotedSpace.hs" 21 1 21 1
+            , SrcSpan "tests/examples/PromotedSpace.hs" 21 1 21 1
+            ]
+        }
+      (Just
+         (ModuleHead
+            SrcSpanInfo
+              { srcInfoSpan = SrcSpan "tests/examples/PromotedSpace.hs" 2 1 2 27
+              , srcInfoPoints =
+                  [ SrcSpan "tests/examples/PromotedSpace.hs" 2 1 2 7
+                  , SrcSpan "tests/examples/PromotedSpace.hs" 2 22 2 27
+                  ]
+              }
+            (ModuleName
+               SrcSpanInfo
+                 { srcInfoSpan = SrcSpan "tests/examples/PromotedSpace.hs" 2 8 2 21
+                 , srcInfoPoints = []
+                 }
+               "PromotedSpace")
+            Nothing
+            Nothing))
+      [ LanguagePragma
+          SrcSpanInfo
+            { srcInfoSpan = SrcSpan "tests/examples/PromotedSpace.hs" 1 1 1 27
+            , srcInfoPoints =
+                [ SrcSpan "tests/examples/PromotedSpace.hs" 1 1 1 13
+                , SrcSpan "tests/examples/PromotedSpace.hs" 1 24 1 27
+                ]
+            }
+          [ Ident
+              SrcSpanInfo
+                { srcInfoSpan = SrcSpan "tests/examples/PromotedSpace.hs" 1 14 1 23
+                , srcInfoPoints = []
+                }
+              "DataKinds"
+          ]
+      ]
+      []
+      [ TypeDecl
+          SrcSpanInfo
+            { srcInfoSpan = SrcSpan "tests/examples/PromotedSpace.hs" 5 1 5 22
+            , srcInfoPoints =
+                [ SrcSpan "tests/examples/PromotedSpace.hs" 5 1 5 5
+                , SrcSpan "tests/examples/PromotedSpace.hs" 5 10 5 11
+                ]
+            }
+          (DHead
+             SrcSpanInfo
+               { srcInfoSpan = SrcSpan "tests/examples/PromotedSpace.hs" 5 6 5 9
+               , srcInfoPoints = []
+               }
+             (Ident
+                SrcSpanInfo
+                  { srcInfoSpan = SrcSpan "tests/examples/PromotedSpace.hs" 5 6 5 9
+                  , srcInfoPoints = []
+                  }
+                "PL1"))
+          (TyPromoted
+             SrcSpanInfo
+               { srcInfoSpan = SrcSpan "tests/examples/PromotedSpace.hs" 5 12 5 22
+               , srcInfoPoints =
+                   [ SrcSpan "tests/examples/PromotedSpace.hs" 5 12 5 13
+                   , SrcSpan "tests/examples/PromotedSpace.hs" 5 21 5 22
+                   ]
+               }
+             (PromotedList
+                SrcSpanInfo
+                  { srcInfoSpan = SrcSpan "tests/examples/PromotedSpace.hs" 5 12 5 22
+                  , srcInfoPoints =
+                      [ SrcSpan "tests/examples/PromotedSpace.hs" 5 12 5 13
+                      , SrcSpan "tests/examples/PromotedSpace.hs" 5 21 5 22
+                      ]
+                  }
+                True
+                [ TyPromoted
+                    SrcSpanInfo
+                      { srcInfoSpan = SrcSpan "tests/examples/PromotedSpace.hs" 5 15 5 20
+                      , srcInfoPoints =
+                          [ SrcSpan "tests/examples/PromotedSpace.hs" 5 15 5 16 ]
+                      }
+                    (PromotedCon
+                       SrcSpanInfo
+                         { srcInfoSpan = SrcSpan "tests/examples/PromotedSpace.hs" 5 15 5 20
+                         , srcInfoPoints =
+                             [ SrcSpan "tests/examples/PromotedSpace.hs" 5 15 5 16 ]
+                         }
+                       True
+                       (UnQual
+                          SrcSpanInfo
+                            { srcInfoSpan = SrcSpan "tests/examples/PromotedSpace.hs" 5 16 5 20
+                            , srcInfoPoints = []
+                            }
+                          (Ident
+                             SrcSpanInfo
+                               { srcInfoSpan = SrcSpan "tests/examples/PromotedSpace.hs" 5 16 5 20
+                               , srcInfoPoints = []
+                               }
+                             "True")))
+                ]))
+      , TypeDecl
+          SrcSpanInfo
+            { srcInfoSpan = SrcSpan "tests/examples/PromotedSpace.hs" 8 1 8 23
+            , srcInfoPoints =
+                [ SrcSpan "tests/examples/PromotedSpace.hs" 8 1 8 5
+                , SrcSpan "tests/examples/PromotedSpace.hs" 8 10 8 11
+                ]
+            }
+          (DHead
+             SrcSpanInfo
+               { srcInfoSpan = SrcSpan "tests/examples/PromotedSpace.hs" 8 6 8 9
+               , srcInfoPoints = []
+               }
+             (Ident
+                SrcSpanInfo
+                  { srcInfoSpan = SrcSpan "tests/examples/PromotedSpace.hs" 8 6 8 9
+                  , srcInfoPoints = []
+                  }
+                "PL2"))
+          (TyPromoted
+             SrcSpanInfo
+               { srcInfoSpan = SrcSpan "tests/examples/PromotedSpace.hs" 8 12 8 23
+               , srcInfoPoints =
+                   [ SrcSpan "tests/examples/PromotedSpace.hs" 8 12 8 13
+                   , SrcSpan "tests/examples/PromotedSpace.hs" 8 22 8 23
+                   ]
+               }
+             (PromotedList
+                SrcSpanInfo
+                  { srcInfoSpan = SrcSpan "tests/examples/PromotedSpace.hs" 8 12 8 23
+                  , srcInfoPoints =
+                      [ SrcSpan "tests/examples/PromotedSpace.hs" 8 12 8 13
+                      , SrcSpan "tests/examples/PromotedSpace.hs" 8 22 8 23
+                      ]
+                  }
+                True
+                [ TyPromoted
+                    SrcSpanInfo
+                      { srcInfoSpan = SrcSpan "tests/examples/PromotedSpace.hs" 8 15 8 21
+                      , srcInfoPoints =
+                          [ SrcSpan "tests/examples/PromotedSpace.hs" 8 15 8 16
+                          , SrcSpan "tests/examples/PromotedSpace.hs" 8 20 8 21
+                          ]
+                      }
+                    (PromotedList
+                       SrcSpanInfo
+                         { srcInfoSpan = SrcSpan "tests/examples/PromotedSpace.hs" 8 15 8 21
+                         , srcInfoPoints =
+                             [ SrcSpan "tests/examples/PromotedSpace.hs" 8 15 8 16
+                             , SrcSpan "tests/examples/PromotedSpace.hs" 8 20 8 21
+                             ]
+                         }
+                       True
+                       [ TyCon
+                           SrcSpanInfo
+                             { srcInfoSpan = SrcSpan "tests/examples/PromotedSpace.hs" 8 17 8 20
+                             , srcInfoPoints = []
+                             }
+                           (UnQual
+                              SrcSpanInfo
+                                { srcInfoSpan = SrcSpan "tests/examples/PromotedSpace.hs" 8 17 8 20
+                                , srcInfoPoints = []
+                                }
+                              (Ident
+                                 SrcSpanInfo
+                                   { srcInfoSpan =
+                                       SrcSpan "tests/examples/PromotedSpace.hs" 8 17 8 20
+                                   , srcInfoPoints = []
+                                   }
+                                 "Int"))
+                       ])
+                ]))
+      , TypeDecl
+          SrcSpanInfo
+            { srcInfoSpan =
+                SrcSpan "tests/examples/PromotedSpace.hs" 11 1 11 29
+            , srcInfoPoints =
+                [ SrcSpan "tests/examples/PromotedSpace.hs" 11 1 11 5
+                , SrcSpan "tests/examples/PromotedSpace.hs" 11 10 11 11
+                ]
+            }
+          (DHead
+             SrcSpanInfo
+               { srcInfoSpan = SrcSpan "tests/examples/PromotedSpace.hs" 11 6 11 9
+               , srcInfoPoints = []
+               }
+             (Ident
+                SrcSpanInfo
+                  { srcInfoSpan = SrcSpan "tests/examples/PromotedSpace.hs" 11 6 11 9
+                  , srcInfoPoints = []
+                  }
+                "PL3"))
+          (TyPromoted
+             SrcSpanInfo
+               { srcInfoSpan =
+                   SrcSpan "tests/examples/PromotedSpace.hs" 11 12 11 29
+               , srcInfoPoints =
+                   [ SrcSpan "tests/examples/PromotedSpace.hs" 11 12 11 13
+                   , SrcSpan "tests/examples/PromotedSpace.hs" 11 28 11 29
+                   ]
+               }
+             (PromotedList
+                SrcSpanInfo
+                  { srcInfoSpan =
+                      SrcSpan "tests/examples/PromotedSpace.hs" 11 12 11 29
+                  , srcInfoPoints =
+                      [ SrcSpan "tests/examples/PromotedSpace.hs" 11 12 11 13
+                      , SrcSpan "tests/examples/PromotedSpace.hs" 11 28 11 29
+                      ]
+                  }
+                True
+                [ TyPromoted
+                    SrcSpanInfo
+                      { srcInfoSpan =
+                          SrcSpan "tests/examples/PromotedSpace.hs" 11 15 11 27
+                      , srcInfoPoints =
+                          [ SrcSpan "tests/examples/PromotedSpace.hs" 11 15 11 16
+                          , SrcSpan "tests/examples/PromotedSpace.hs" 11 20 11 21
+                          , SrcSpan "tests/examples/PromotedSpace.hs" 11 26 11 27
+                          ]
+                      }
+                    (PromotedTuple
+                       SrcSpanInfo
+                         { srcInfoSpan =
+                             SrcSpan "tests/examples/PromotedSpace.hs" 11 15 11 27
+                         , srcInfoPoints =
+                             [ SrcSpan "tests/examples/PromotedSpace.hs" 11 15 11 16
+                             , SrcSpan "tests/examples/PromotedSpace.hs" 11 20 11 21
+                             , SrcSpan "tests/examples/PromotedSpace.hs" 11 26 11 27
+                             ]
+                         }
+                       [ TyCon
+                           SrcSpanInfo
+                             { srcInfoSpan =
+                                 SrcSpan "tests/examples/PromotedSpace.hs" 11 17 11 20
+                             , srcInfoPoints = []
+                             }
+                           (UnQual
+                              SrcSpanInfo
+                                { srcInfoSpan =
+                                    SrcSpan "tests/examples/PromotedSpace.hs" 11 17 11 20
+                                , srcInfoPoints = []
+                                }
+                              (Ident
+                                 SrcSpanInfo
+                                   { srcInfoSpan =
+                                       SrcSpan "tests/examples/PromotedSpace.hs" 11 17 11 20
+                                   , srcInfoPoints = []
+                                   }
+                                 "Int"))
+                       , TyCon
+                           SrcSpanInfo
+                             { srcInfoSpan =
+                                 SrcSpan "tests/examples/PromotedSpace.hs" 11 22 11 26
+                             , srcInfoPoints = []
+                             }
+                           (UnQual
+                              SrcSpanInfo
+                                { srcInfoSpan =
+                                    SrcSpan "tests/examples/PromotedSpace.hs" 11 22 11 26
+                                , srcInfoPoints = []
+                                }
+                              (Ident
+                                 SrcSpanInfo
+                                   { srcInfoSpan =
+                                       SrcSpan "tests/examples/PromotedSpace.hs" 11 22 11 26
+                                   , srcInfoPoints = []
+                                   }
+                                 "Bool"))
+                       ])
+                ]))
+      , TypeDecl
+          SrcSpanInfo
+            { srcInfoSpan =
+                SrcSpan "tests/examples/PromotedSpace.hs" 14 1 14 29
+            , srcInfoPoints =
+                [ SrcSpan "tests/examples/PromotedSpace.hs" 14 1 14 5
+                , SrcSpan "tests/examples/PromotedSpace.hs" 14 10 14 11
+                ]
+            }
+          (DHead
+             SrcSpanInfo
+               { srcInfoSpan = SrcSpan "tests/examples/PromotedSpace.hs" 14 6 14 9
+               , srcInfoPoints = []
+               }
+             (Ident
+                SrcSpanInfo
+                  { srcInfoSpan = SrcSpan "tests/examples/PromotedSpace.hs" 14 6 14 9
+                  , srcInfoPoints = []
+                  }
+                "PT1"))
+          (TyPromoted
+             SrcSpanInfo
+               { srcInfoSpan =
+                   SrcSpan "tests/examples/PromotedSpace.hs" 14 12 14 29
+               , srcInfoPoints =
+                   [ SrcSpan "tests/examples/PromotedSpace.hs" 14 12 14 13
+                   , SrcSpan "tests/examples/PromotedSpace.hs" 14 20 14 21
+                   , SrcSpan "tests/examples/PromotedSpace.hs" 14 28 14 29
+                   ]
+               }
+             (PromotedTuple
+                SrcSpanInfo
+                  { srcInfoSpan =
+                      SrcSpan "tests/examples/PromotedSpace.hs" 14 12 14 29
+                  , srcInfoPoints =
+                      [ SrcSpan "tests/examples/PromotedSpace.hs" 14 12 14 13
+                      , SrcSpan "tests/examples/PromotedSpace.hs" 14 20 14 21
+                      , SrcSpan "tests/examples/PromotedSpace.hs" 14 28 14 29
+                      ]
+                  }
+                [ TyPromoted
+                    SrcSpanInfo
+                      { srcInfoSpan =
+                          SrcSpan "tests/examples/PromotedSpace.hs" 14 15 14 20
+                      , srcInfoPoints =
+                          [ SrcSpan "tests/examples/PromotedSpace.hs" 14 15 14 16 ]
+                      }
+                    (PromotedCon
+                       SrcSpanInfo
+                         { srcInfoSpan =
+                             SrcSpan "tests/examples/PromotedSpace.hs" 14 15 14 20
+                         , srcInfoPoints =
+                             [ SrcSpan "tests/examples/PromotedSpace.hs" 14 15 14 16 ]
+                         }
+                       True
+                       (UnQual
+                          SrcSpanInfo
+                            { srcInfoSpan =
+                                SrcSpan "tests/examples/PromotedSpace.hs" 14 16 14 20
+                            , srcInfoPoints = []
+                            }
+                          (Ident
+                             SrcSpanInfo
+                               { srcInfoSpan =
+                                   SrcSpan "tests/examples/PromotedSpace.hs" 14 16 14 20
+                               , srcInfoPoints = []
+                               }
+                             "True")))
+                , TyCon
+                    SrcSpanInfo
+                      { srcInfoSpan =
+                          SrcSpan "tests/examples/PromotedSpace.hs" 14 22 14 27
+                      , srcInfoPoints = []
+                      }
+                    (UnQual
+                       SrcSpanInfo
+                         { srcInfoSpan =
+                             SrcSpan "tests/examples/PromotedSpace.hs" 14 22 14 27
+                         , srcInfoPoints = []
+                         }
+                       (Ident
+                          SrcSpanInfo
+                            { srcInfoSpan =
+                                SrcSpan "tests/examples/PromotedSpace.hs" 14 22 14 27
+                            , srcInfoPoints = []
+                            }
+                          "False"))
+                ]))
+      , TypeDecl
+          SrcSpanInfo
+            { srcInfoSpan =
+                SrcSpan "tests/examples/PromotedSpace.hs" 17 1 17 29
+            , srcInfoPoints =
+                [ SrcSpan "tests/examples/PromotedSpace.hs" 17 1 17 5
+                , SrcSpan "tests/examples/PromotedSpace.hs" 17 10 17 11
+                ]
+            }
+          (DHead
+             SrcSpanInfo
+               { srcInfoSpan = SrcSpan "tests/examples/PromotedSpace.hs" 17 6 17 9
+               , srcInfoPoints = []
+               }
+             (Ident
+                SrcSpanInfo
+                  { srcInfoSpan = SrcSpan "tests/examples/PromotedSpace.hs" 17 6 17 9
+                  , srcInfoPoints = []
+                  }
+                "PT2"))
+          (TyPromoted
+             SrcSpanInfo
+               { srcInfoSpan =
+                   SrcSpan "tests/examples/PromotedSpace.hs" 17 12 17 29
+               , srcInfoPoints =
+                   [ SrcSpan "tests/examples/PromotedSpace.hs" 17 12 17 13
+                   , SrcSpan "tests/examples/PromotedSpace.hs" 17 21 17 22
+                   , SrcSpan "tests/examples/PromotedSpace.hs" 17 28 17 29
+                   ]
+               }
+             (PromotedTuple
+                SrcSpanInfo
+                  { srcInfoSpan =
+                      SrcSpan "tests/examples/PromotedSpace.hs" 17 12 17 29
+                  , srcInfoPoints =
+                      [ SrcSpan "tests/examples/PromotedSpace.hs" 17 12 17 13
+                      , SrcSpan "tests/examples/PromotedSpace.hs" 17 21 17 22
+                      , SrcSpan "tests/examples/PromotedSpace.hs" 17 28 17 29
+                      ]
+                  }
+                [ TyPromoted
+                    SrcSpanInfo
+                      { srcInfoSpan =
+                          SrcSpan "tests/examples/PromotedSpace.hs" 17 15 17 21
+                      , srcInfoPoints =
+                          [ SrcSpan "tests/examples/PromotedSpace.hs" 17 15 17 16
+                          , SrcSpan "tests/examples/PromotedSpace.hs" 17 20 17 21
+                          ]
+                      }
+                    (PromotedList
+                       SrcSpanInfo
+                         { srcInfoSpan =
+                             SrcSpan "tests/examples/PromotedSpace.hs" 17 15 17 21
+                         , srcInfoPoints =
+                             [ SrcSpan "tests/examples/PromotedSpace.hs" 17 15 17 16
+                             , SrcSpan "tests/examples/PromotedSpace.hs" 17 20 17 21
+                             ]
+                         }
+                       True
+                       [ TyCon
+                           SrcSpanInfo
+                             { srcInfoSpan =
+                                 SrcSpan "tests/examples/PromotedSpace.hs" 17 17 17 20
+                             , srcInfoPoints = []
+                             }
+                           (UnQual
+                              SrcSpanInfo
+                                { srcInfoSpan =
+                                    SrcSpan "tests/examples/PromotedSpace.hs" 17 17 17 20
+                                , srcInfoPoints = []
+                                }
+                              (Ident
+                                 SrcSpanInfo
+                                   { srcInfoSpan =
+                                       SrcSpan "tests/examples/PromotedSpace.hs" 17 17 17 20
+                                   , srcInfoPoints = []
+                                   }
+                                 "Int"))
+                       ])
+                , TyCon
+                    SrcSpanInfo
+                      { srcInfoSpan =
+                          SrcSpan "tests/examples/PromotedSpace.hs" 17 23 17 27
+                      , srcInfoPoints = []
+                      }
+                    (UnQual
+                       SrcSpanInfo
+                         { srcInfoSpan =
+                             SrcSpan "tests/examples/PromotedSpace.hs" 17 23 17 27
+                         , srcInfoPoints = []
+                         }
+                       (Ident
+                          SrcSpanInfo
+                            { srcInfoSpan =
+                                SrcSpan "tests/examples/PromotedSpace.hs" 17 23 17 27
+                            , srcInfoPoints = []
+                            }
+                          "Bool"))
+                ]))
+      , TypeDecl
+          SrcSpanInfo
+            { srcInfoSpan =
+                SrcSpan "tests/examples/PromotedSpace.hs" 20 1 20 35
+            , srcInfoPoints =
+                [ SrcSpan "tests/examples/PromotedSpace.hs" 20 1 20 5
+                , SrcSpan "tests/examples/PromotedSpace.hs" 20 10 20 11
+                ]
+            }
+          (DHead
+             SrcSpanInfo
+               { srcInfoSpan = SrcSpan "tests/examples/PromotedSpace.hs" 20 6 20 9
+               , srcInfoPoints = []
+               }
+             (Ident
+                SrcSpanInfo
+                  { srcInfoSpan = SrcSpan "tests/examples/PromotedSpace.hs" 20 6 20 9
+                  , srcInfoPoints = []
+                  }
+                "PT3"))
+          (TyPromoted
+             SrcSpanInfo
+               { srcInfoSpan =
+                   SrcSpan "tests/examples/PromotedSpace.hs" 20 12 20 35
+               , srcInfoPoints =
+                   [ SrcSpan "tests/examples/PromotedSpace.hs" 20 12 20 13
+                   , SrcSpan "tests/examples/PromotedSpace.hs" 20 27 20 28
+                   , SrcSpan "tests/examples/PromotedSpace.hs" 20 34 20 35
+                   ]
+               }
+             (PromotedTuple
+                SrcSpanInfo
+                  { srcInfoSpan =
+                      SrcSpan "tests/examples/PromotedSpace.hs" 20 12 20 35
+                  , srcInfoPoints =
+                      [ SrcSpan "tests/examples/PromotedSpace.hs" 20 12 20 13
+                      , SrcSpan "tests/examples/PromotedSpace.hs" 20 27 20 28
+                      , SrcSpan "tests/examples/PromotedSpace.hs" 20 34 20 35
+                      ]
+                  }
+                [ TyPromoted
+                    SrcSpanInfo
+                      { srcInfoSpan =
+                          SrcSpan "tests/examples/PromotedSpace.hs" 20 15 20 27
+                      , srcInfoPoints =
+                          [ SrcSpan "tests/examples/PromotedSpace.hs" 20 15 20 16
+                          , SrcSpan "tests/examples/PromotedSpace.hs" 20 20 20 21
+                          , SrcSpan "tests/examples/PromotedSpace.hs" 20 26 20 27
+                          ]
+                      }
+                    (PromotedTuple
+                       SrcSpanInfo
+                         { srcInfoSpan =
+                             SrcSpan "tests/examples/PromotedSpace.hs" 20 15 20 27
+                         , srcInfoPoints =
+                             [ SrcSpan "tests/examples/PromotedSpace.hs" 20 15 20 16
+                             , SrcSpan "tests/examples/PromotedSpace.hs" 20 20 20 21
+                             , SrcSpan "tests/examples/PromotedSpace.hs" 20 26 20 27
+                             ]
+                         }
+                       [ TyCon
+                           SrcSpanInfo
+                             { srcInfoSpan =
+                                 SrcSpan "tests/examples/PromotedSpace.hs" 20 17 20 20
+                             , srcInfoPoints = []
+                             }
+                           (UnQual
+                              SrcSpanInfo
+                                { srcInfoSpan =
+                                    SrcSpan "tests/examples/PromotedSpace.hs" 20 17 20 20
+                                , srcInfoPoints = []
+                                }
+                              (Ident
+                                 SrcSpanInfo
+                                   { srcInfoSpan =
+                                       SrcSpan "tests/examples/PromotedSpace.hs" 20 17 20 20
+                                   , srcInfoPoints = []
+                                   }
+                                 "Int"))
+                       , TyCon
+                           SrcSpanInfo
+                             { srcInfoSpan =
+                                 SrcSpan "tests/examples/PromotedSpace.hs" 20 22 20 26
+                             , srcInfoPoints = []
+                             }
+                           (UnQual
+                              SrcSpanInfo
+                                { srcInfoSpan =
+                                    SrcSpan "tests/examples/PromotedSpace.hs" 20 22 20 26
+                                , srcInfoPoints = []
+                                }
+                              (Ident
+                                 SrcSpanInfo
+                                   { srcInfoSpan =
+                                       SrcSpan "tests/examples/PromotedSpace.hs" 20 22 20 26
+                                   , srcInfoPoints = []
+                                   }
+                                 "Bool"))
+                       ])
+                , TyCon
+                    SrcSpanInfo
+                      { srcInfoSpan =
+                          SrcSpan "tests/examples/PromotedSpace.hs" 20 29 20 33
+                      , srcInfoPoints = []
+                      }
+                    (UnQual
+                       SrcSpanInfo
+                         { srcInfoSpan =
+                             SrcSpan "tests/examples/PromotedSpace.hs" 20 29 20 33
+                         , srcInfoPoints = []
+                         }
+                       (Ident
+                          SrcSpanInfo
+                            { srcInfoSpan =
+                                SrcSpan "tests/examples/PromotedSpace.hs" 20 29 20 33
+                            , srcInfoPoints = []
+                            }
+                          "Char"))
+                ]))
+      ]
+  , [ Comment
+        False
+        (SrcSpan "tests/examples/PromotedSpace.hs" 4 1 4 60)
+        " Promoted list containing promoted constructor with quote"
+    , Comment
+        False
+        (SrcSpan "tests/examples/PromotedSpace.hs" 7 1 7 42)
+        " Promoted list containing promoted list"
+    , Comment
+        False
+        (SrcSpan "tests/examples/PromotedSpace.hs" 10 1 10 43)
+        " Promoted list containing promoted tuple"
+    , Comment
+        False
+        (SrcSpan "tests/examples/PromotedSpace.hs" 13 1 13 61)
+        " Promoted tuple containing promoted constructor with quote"
+    , Comment
+        False
+        (SrcSpan "tests/examples/PromotedSpace.hs" 16 1 16 43)
+        " Promoted tuple containing promoted list"
+    , Comment
+        False
+        (SrcSpan "tests/examples/PromotedSpace.hs" 19 1 19 44)
+        " Promoted tuple containing promoted tuple"
+    ]
+  )
diff --git a/tests/examples/PromotedSpace.hs.prettyparser.golden b/tests/examples/PromotedSpace.hs.prettyparser.golden
new file mode 100644
--- /dev/null
+++ b/tests/examples/PromotedSpace.hs.prettyparser.golden
@@ -0,0 +1,1 @@
+Match
diff --git a/tests/examples/PromotedSpace.hs.prettyprinter.golden b/tests/examples/PromotedSpace.hs.prettyprinter.golden
new file mode 100644
--- /dev/null
+++ b/tests/examples/PromotedSpace.hs.prettyprinter.golden
@@ -0,0 +1,14 @@
+{-# LANGUAGE DataKinds #-}
+module PromotedSpace where
+
+type PL1 = '[ 'True]
+
+type PL2 = '[ '[Int]]
+
+type PL3 = '[ '(Int, Bool)]
+
+type PT1 = '( 'True, False)
+
+type PT2 = '( '[Int], Bool)
+
+type PT3 = '( '(Int, Bool), Char)
diff --git a/tests/examples/T326.hs b/tests/examples/T326.hs
new file mode 100644
--- /dev/null
+++ b/tests/examples/T326.hs
@@ -0,0 +1,4 @@
+{-# LANGUAGE TypeApplications #-}
+module T326 where
+
+(@:) a b = a
diff --git a/tests/examples/T326.hs.exactprinter.golden b/tests/examples/T326.hs.exactprinter.golden
new file mode 100644
--- /dev/null
+++ b/tests/examples/T326.hs.exactprinter.golden
@@ -0,0 +1,1 @@
+Match
diff --git a/tests/examples/T326.hs.parser.golden b/tests/examples/T326.hs.parser.golden
new file mode 100644
--- /dev/null
+++ b/tests/examples/T326.hs.parser.golden
@@ -0,0 +1,116 @@
+ParseOk
+  ( Module
+      SrcSpanInfo
+        { srcInfoSpan = SrcSpan "tests/examples/T326.hs" 1 1 5 1
+        , srcInfoPoints =
+            [ SrcSpan "tests/examples/T326.hs" 1 1 1 1
+            , SrcSpan "tests/examples/T326.hs" 2 1 2 1
+            , SrcSpan "tests/examples/T326.hs" 2 1 2 1
+            , SrcSpan "tests/examples/T326.hs" 4 1 4 1
+            , SrcSpan "tests/examples/T326.hs" 5 1 5 1
+            , SrcSpan "tests/examples/T326.hs" 5 1 5 1
+            ]
+        }
+      (Just
+         (ModuleHead
+            SrcSpanInfo
+              { srcInfoSpan = SrcSpan "tests/examples/T326.hs" 2 1 2 18
+              , srcInfoPoints =
+                  [ SrcSpan "tests/examples/T326.hs" 2 1 2 7
+                  , SrcSpan "tests/examples/T326.hs" 2 13 2 18
+                  ]
+              }
+            (ModuleName
+               SrcSpanInfo
+                 { srcInfoSpan = SrcSpan "tests/examples/T326.hs" 2 8 2 12
+                 , srcInfoPoints = []
+                 }
+               "T326")
+            Nothing
+            Nothing))
+      [ LanguagePragma
+          SrcSpanInfo
+            { srcInfoSpan = SrcSpan "tests/examples/T326.hs" 1 1 1 34
+            , srcInfoPoints =
+                [ SrcSpan "tests/examples/T326.hs" 1 1 1 13
+                , SrcSpan "tests/examples/T326.hs" 1 31 1 34
+                ]
+            }
+          [ Ident
+              SrcSpanInfo
+                { srcInfoSpan = SrcSpan "tests/examples/T326.hs" 1 14 1 30
+                , srcInfoPoints = []
+                }
+              "TypeApplications"
+          ]
+      ]
+      []
+      [ FunBind
+          SrcSpanInfo
+            { srcInfoSpan = SrcSpan "tests/examples/T326.hs" 4 1 4 13
+            , srcInfoPoints = []
+            }
+          [ Match
+              SrcSpanInfo
+                { srcInfoSpan = SrcSpan "tests/examples/T326.hs" 4 1 4 13
+                , srcInfoPoints =
+                    [ SrcSpan "tests/examples/T326.hs" 4 1 4 2
+                    , SrcSpan "tests/examples/T326.hs" 4 2 4 4
+                    , SrcSpan "tests/examples/T326.hs" 4 4 4 5
+                    ]
+                }
+              (Symbol
+                 SrcSpanInfo
+                   { srcInfoSpan = SrcSpan "tests/examples/T326.hs" 4 2 4 4
+                   , srcInfoPoints = []
+                   }
+                 "@:")
+              [ PVar
+                  SrcSpanInfo
+                    { srcInfoSpan = SrcSpan "tests/examples/T326.hs" 4 6 4 7
+                    , srcInfoPoints = []
+                    }
+                  (Ident
+                     SrcSpanInfo
+                       { srcInfoSpan = SrcSpan "tests/examples/T326.hs" 4 6 4 7
+                       , srcInfoPoints = []
+                       }
+                     "a")
+              , PVar
+                  SrcSpanInfo
+                    { srcInfoSpan = SrcSpan "tests/examples/T326.hs" 4 8 4 9
+                    , srcInfoPoints = []
+                    }
+                  (Ident
+                     SrcSpanInfo
+                       { srcInfoSpan = SrcSpan "tests/examples/T326.hs" 4 8 4 9
+                       , srcInfoPoints = []
+                       }
+                     "b")
+              ]
+              (UnGuardedRhs
+                 SrcSpanInfo
+                   { srcInfoSpan = SrcSpan "tests/examples/T326.hs" 4 10 4 13
+                   , srcInfoPoints = [ SrcSpan "tests/examples/T326.hs" 4 10 4 11 ]
+                   }
+                 (Var
+                    SrcSpanInfo
+                      { srcInfoSpan = SrcSpan "tests/examples/T326.hs" 4 12 4 13
+                      , srcInfoPoints = []
+                      }
+                    (UnQual
+                       SrcSpanInfo
+                         { srcInfoSpan = SrcSpan "tests/examples/T326.hs" 4 12 4 13
+                         , srcInfoPoints = []
+                         }
+                       (Ident
+                          SrcSpanInfo
+                            { srcInfoSpan = SrcSpan "tests/examples/T326.hs" 4 12 4 13
+                            , srcInfoPoints = []
+                            }
+                          "a"))))
+              Nothing
+          ]
+      ]
+  , []
+  )
diff --git a/tests/examples/T326.hs.prettyparser.golden b/tests/examples/T326.hs.prettyparser.golden
new file mode 100644
--- /dev/null
+++ b/tests/examples/T326.hs.prettyparser.golden
@@ -0,0 +1,1 @@
+Match
diff --git a/tests/examples/T326.hs.prettyprinter.golden b/tests/examples/T326.hs.prettyprinter.golden
new file mode 100644
--- /dev/null
+++ b/tests/examples/T326.hs.prettyprinter.golden
@@ -0,0 +1,3 @@
+{-# LANGUAGE TypeApplications #-}
+module T326 where
+(@:) a b = a
