Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the Pretty instance for HsOuterSigTyVarBndrs #906

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 24 additions & 16 deletions src/HIndent/Ast/Declaration/Data/GADT/Constructor.hs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import qualified GHC.Types.SrcLoc as GHC
import HIndent.Ast.Context
import HIndent.Ast.Declaration.Data.GADT.Constructor.Signature
import HIndent.Ast.NodeComments
import HIndent.Ast.Type.Variable
import HIndent.Ast.WithComments
import qualified HIndent.GhcLibParserWrapper.GHC.Hs as GHC
import {-# SOURCE #-} HIndent.Pretty
Expand All @@ -21,8 +22,7 @@ import qualified Data.List.NonEmpty as NE
#endif
data GADTConstructor = GADTConstructor
{ names :: [WithComments (GHC.IdP GHC.GhcPs)]
, forallNeeded :: Bool
, bindings :: WithComments (GHC.HsOuterSigTyVarBndrs GHC.GhcPs)
, bindings :: Maybe (WithComments [WithComments TypeVariable])
, context :: Maybe (WithComments Context)
, signature :: ConstructorSignature
}
Expand All @@ -38,18 +38,22 @@ instance Pretty GADTConstructor where
hor = string " :: " |=> body
ver = newline >> indentedBlock (string ":: " |=> body)
body =
case (forallNeeded, context) of
(True, Just ctx) -> withForallCtx ctx
(True, Nothing) -> withForallOnly
(False, Just ctx) -> withCtxOnly ctx
(False, Nothing) -> noForallCtx
withForallCtx ctx = do
pretty bindings
case (bindings, context) of
(Just bs, Just ctx) -> withForallCtx bs ctx
(Just bs, Nothing) -> withForallOnly bs
(Nothing, Just ctx) -> withCtxOnly ctx
(Nothing, Nothing) -> noForallCtx
withForallCtx bs ctx = do
string "forall"
prettyWith bs (spacePrefixed . fmap pretty)
dot
(space >> pretty ctx) <-|> (newline >> pretty ctx)
newline
prefixed "=> " $ prettyVertically signature
withForallOnly = do
pretty bindings
withForallOnly bs = do
string "forall"
prettyWith bs (spacePrefixed . fmap pretty)
dot
(space >> prettyHorizontally signature)
<-|> (newline >> prettyVertically signature)
withCtxOnly ctx =
Expand All @@ -61,11 +65,15 @@ mkGADTConstructor :: GHC.ConDecl GHC.GhcPs -> Maybe GADTConstructor
mkGADTConstructor [email protected] {..} = Just $ GADTConstructor {..}
where
names = fromMaybe (error "Couldn't get names.") $ getNames decl
bindings = fromGenLocated con_bndrs
forallNeeded =
case GHC.unLoc con_bndrs of
GHC.HsOuterImplicit {} -> False
GHC.HsOuterExplicit {} -> True
bindings =
case con_bndrs of
GHC.L _ GHC.HsOuterImplicit {} -> Nothing
GHC.L l GHC.HsOuterExplicit {..} ->
Just
$ fromGenLocated
$ fmap
(fmap (fmap mkTypeVariable . fromGenLocated))
(GHC.L l hso_bndrs)
signature =
fromMaybe (error "Couldn't get signature.") $ mkConstructorSignature decl
context = fmap (fmap mkContext . fromGenLocated) con_mb_cxt
Expand Down
8 changes: 0 additions & 8 deletions src/HIndent/Pretty.hs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
import qualified Language.Haskell.GhclibParserEx.GHC.Hs.Expr as GHC
import Text.Show.Unicode
#if MIN_VERSION_ghc_lib_parser(9,6,1)
import qualified Data.Foldable as NonEmpty

Check warning on line 58 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (ubuntu-latest, 9.2.8)

The qualified import of ‘Data.Foldable’ is redundant

Check warning on line 58 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (ubuntu-latest, 9.2.8)

The qualified import of ‘Data.Foldable’ is redundant

Check warning on line 58 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (ubuntu-latest, 9.4.8)

The qualified import of ‘Data.Foldable’ is redundant

Check warning on line 58 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (ubuntu-latest, 9.4.8)

The qualified import of ‘Data.Foldable’ is redundant

Check warning on line 58 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (ubuntu-latest, 9.8.1)

The qualified import of ‘Data.Foldable’ is redundant

Check warning on line 58 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (ubuntu-latest, 9.8.1)

The qualified import of ‘Data.Foldable’ is redundant

Check warning on line 58 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (ubuntu-latest, 9.6.4)

The qualified import of ‘Data.Foldable’ is redundant

Check warning on line 58 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (ubuntu-latest, 9.6.4)

The qualified import of ‘Data.Foldable’ is redundant

Check warning on line 58 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (ubuntu-latest, nightly)

The qualified import of ‘Data.Foldable’ is redundant

Check warning on line 58 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (ubuntu-latest, nightly)

The qualified import of ‘Data.Foldable’ is redundant

Check warning on line 58 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (ubuntu-latest, nightly)

The qualified import of ‘Data.Foldable’ is redundant

Check warning on line 58 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (ubuntu-latest, nightly)

The qualified import of ‘Data.Foldable’ is redundant

Check warning on line 58 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (windows-latest, 9.4.8)

The qualified import of ‘Data.Foldable’ is redundant

Check warning on line 58 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (windows-latest, 9.4.8)

The qualified import of ‘Data.Foldable’ is redundant

Check warning on line 58 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (windows-latest, 9.6.4)

The qualified import of ‘Data.Foldable’ is redundant

Check warning on line 58 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (windows-latest, 9.6.4)

The qualified import of ‘Data.Foldable’ is redundant

Check warning on line 58 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (windows-latest, 9.2.8)

The qualified import of ‘Data.Foldable’ is redundant

Check warning on line 58 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (windows-latest, 9.2.8)

The qualified import of ‘Data.Foldable’ is redundant

Check warning on line 58 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (macos-13, 9.4.8)

The qualified import of ‘Data.Foldable’ is redundant

Check warning on line 58 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (macos-13, 9.4.8)

The qualified import of ‘Data.Foldable’ is redundant

Check warning on line 58 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (windows-latest, 9.8.1)

The qualified import of ‘Data.Foldable’ is redundant

Check warning on line 58 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (windows-latest, 9.8.1)

The qualified import of ‘Data.Foldable’ is redundant

Check warning on line 58 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (macos-13, 9.2.8)

The qualified import of ‘Data.Foldable’ is redundant

Check warning on line 58 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (macos-13, 9.2.8)

The qualified import of ‘Data.Foldable’ is redundant

Check warning on line 58 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (macos-13, 9.6.4)

The qualified import of ‘Data.Foldable’ is redundant

Check warning on line 58 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (macos-13, 9.6.4)

The qualified import of ‘Data.Foldable’ is redundant

Check warning on line 58 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (windows-latest, nightly)

The qualified import of `Data.Foldable' is redundant

Check warning on line 58 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (windows-latest, nightly)

The qualified import of `Data.Foldable' is redundant

Check warning on line 58 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (windows-latest, nightly)

The qualified import of `Data.Foldable' is redundant

Check warning on line 58 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (windows-latest, nightly)

The qualified import of `Data.Foldable' is redundant

Check warning on line 58 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (macos-latest, nightly)

The qualified import of ‘Data.Foldable’ is redundant

Check warning on line 58 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (macos-latest, nightly)

The qualified import of ‘Data.Foldable’ is redundant

Check warning on line 58 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (macos-latest, nightly)

The qualified import of ‘Data.Foldable’ is redundant

Check warning on line 58 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (macos-latest, nightly)

The qualified import of ‘Data.Foldable’ is redundant

Check warning on line 58 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (macos-13, 9.8.1)

The qualified import of ‘Data.Foldable’ is redundant

Check warning on line 58 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (macos-13, 9.8.1)

The qualified import of ‘Data.Foldable’ is redundant
import qualified GHC.Core.DataCon as GHC
#endif
#if !MIN_VERSION_ghc_lib_parser(9,6,1)
Expand Down Expand Up @@ -545,7 +545,7 @@
prettyMatchExpr GHC.Match {m_ctxt = GHC.LambdaExpr, ..} = do
string "\\"
unless (null m_pats)
$ case GHC.unLoc $ head m_pats of

Check warning on line 548 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (ubuntu-latest, 9.8.1)

In the use of ‘head’

Check warning on line 548 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (ubuntu-latest, 9.8.1)

In the use of ‘head’

Check warning on line 548 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (ubuntu-latest, nightly)

In the use of ‘head’

Check warning on line 548 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (ubuntu-latest, nightly)

In the use of ‘head’

Check warning on line 548 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (ubuntu-latest, nightly)

In the use of ‘head’

Check warning on line 548 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (ubuntu-latest, nightly)

In the use of ‘head’

Check warning on line 548 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (windows-latest, 9.8.1)

In the use of ‘head’

Check warning on line 548 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (windows-latest, 9.8.1)

In the use of ‘head’

Check warning on line 548 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (windows-latest, nightly)

In the use of `head'

Check warning on line 548 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (windows-latest, nightly)

In the use of `head'

Check warning on line 548 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (windows-latest, nightly)

In the use of `head'

Check warning on line 548 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (windows-latest, nightly)

In the use of `head'

Check warning on line 548 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (macos-latest, nightly)

In the use of ‘head’

Check warning on line 548 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (macos-latest, nightly)

In the use of ‘head’

Check warning on line 548 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (macos-latest, nightly)

In the use of ‘head’

Check warning on line 548 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (macos-latest, nightly)

In the use of ‘head’

Check warning on line 548 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (macos-13, 9.8.1)

In the use of ‘head’

Check warning on line 548 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (macos-13, 9.8.1)

In the use of ‘head’
GHC.LazyPat {} -> space
GHC.BangPat {} -> space
_ -> return ()
Expand Down Expand Up @@ -584,7 +584,7 @@
prettyMatchProc GHC.Match {m_ctxt = GHC.LambdaExpr, ..} = do
string "\\"
unless (null m_pats)
$ case GHC.unLoc $ head m_pats of

Check warning on line 587 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (ubuntu-latest, 9.8.1)

In the use of ‘head’

Check warning on line 587 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (ubuntu-latest, 9.8.1)

In the use of ‘head’

Check warning on line 587 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (ubuntu-latest, nightly)

In the use of ‘head’

Check warning on line 587 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (ubuntu-latest, nightly)

In the use of ‘head’

Check warning on line 587 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (ubuntu-latest, nightly)

In the use of ‘head’

Check warning on line 587 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (ubuntu-latest, nightly)

In the use of ‘head’

Check warning on line 587 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (windows-latest, 9.8.1)

In the use of ‘head’

Check warning on line 587 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (windows-latest, 9.8.1)

In the use of ‘head’

Check warning on line 587 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (windows-latest, nightly)

In the use of `head'

Check warning on line 587 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (windows-latest, nightly)

In the use of `head'

Check warning on line 587 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (windows-latest, nightly)

In the use of `head'

Check warning on line 587 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (windows-latest, nightly)

In the use of `head'

Check warning on line 587 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (macos-latest, nightly)

In the use of ‘head’

Check warning on line 587 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (macos-latest, nightly)

In the use of ‘head’

Check warning on line 587 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (macos-latest, nightly)

In the use of ‘head’

Check warning on line 587 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (macos-latest, nightly)

In the use of ‘head’

Check warning on line 587 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (macos-13, 9.8.1)

In the use of ‘head’

Check warning on line 587 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (macos-13, 9.8.1)

In the use of ‘head’
GHC.LazyPat {} -> space
GHC.BangPat {} -> space
_ -> return ()
Expand Down Expand Up @@ -1216,7 +1216,7 @@
pretty' (GHC.DctMulti _ ts) = hvTuple $ fmap pretty ts

instance Pretty GHC.OverlapMode where
pretty' GHC.NoOverlap {} = notUsedInParsedStage

Check warning on line 1219 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (ubuntu-latest, 9.4.8)

Pattern match(es) are non-exhaustive

Check warning on line 1219 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (ubuntu-latest, 9.8.1)

Pattern match(es) are non-exhaustive

Check warning on line 1219 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (ubuntu-latest, 9.6.4)

Pattern match(es) are non-exhaustive

Check warning on line 1219 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (ubuntu-latest, nightly)

Pattern match(es) are non-exhaustive

Check warning on line 1219 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (ubuntu-latest, nightly)

Pattern match(es) are non-exhaustive

Check warning on line 1219 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (ubuntu-latest, nightly)

Pattern match(es) are non-exhaustive

Check warning on line 1219 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (ubuntu-latest, nightly)

Pattern match(es) are non-exhaustive

Check warning on line 1219 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (windows-latest, 9.4.8)

Pattern match(es) are non-exhaustive

Check warning on line 1219 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (windows-latest, 9.6.4)

Pattern match(es) are non-exhaustive

Check warning on line 1219 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (macos-13, 9.4.8)

Pattern match(es) are non-exhaustive

Check warning on line 1219 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (windows-latest, 9.8.1)

Pattern match(es) are non-exhaustive

Check warning on line 1219 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (macos-13, 9.6.4)

Pattern match(es) are non-exhaustive

Check warning on line 1219 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (windows-latest, nightly)

Pattern match(es) are non-exhaustive

Check warning on line 1219 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (windows-latest, nightly)

Pattern match(es) are non-exhaustive

Check warning on line 1219 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (windows-latest, nightly)

Pattern match(es) are non-exhaustive

Check warning on line 1219 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (windows-latest, nightly)

Pattern match(es) are non-exhaustive

Check warning on line 1219 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (macos-latest, nightly)

Pattern match(es) are non-exhaustive

Check warning on line 1219 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (macos-latest, nightly)

Pattern match(es) are non-exhaustive

Check warning on line 1219 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (macos-latest, nightly)

Pattern match(es) are non-exhaustive

Check warning on line 1219 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (macos-latest, nightly)

Pattern match(es) are non-exhaustive

Check warning on line 1219 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (macos-13, 9.8.1)

Pattern match(es) are non-exhaustive
pretty' GHC.Overlappable {} = string "{-# OVERLAPPABLE #-}"
pretty' GHC.Overlapping {} = string "{-# OVERLAPPING #-}"
pretty' GHC.Overlaps {} = string "{-# OVERLAPS #-}"
Expand Down Expand Up @@ -1333,8 +1333,8 @@
[] -> pure ()
[x'] -> string x'
xs -> do
string $ head xs

Check warning on line 1336 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (ubuntu-latest, 9.8.1)

In the use of ‘head’

Check warning on line 1336 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (ubuntu-latest, 9.8.1)

In the use of ‘head’

Check warning on line 1336 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (ubuntu-latest, nightly)

In the use of ‘head’

Check warning on line 1336 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (ubuntu-latest, nightly)

In the use of ‘head’

Check warning on line 1336 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (ubuntu-latest, nightly)

In the use of ‘head’

Check warning on line 1336 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (ubuntu-latest, nightly)

In the use of ‘head’

Check warning on line 1336 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (windows-latest, 9.8.1)

In the use of ‘head’

Check warning on line 1336 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (windows-latest, 9.8.1)

In the use of ‘head’

Check warning on line 1336 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (windows-latest, nightly)

In the use of `head'

Check warning on line 1336 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (windows-latest, nightly)

In the use of `head'

Check warning on line 1336 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (windows-latest, nightly)

In the use of `head'

Check warning on line 1336 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (windows-latest, nightly)

In the use of `head'

Check warning on line 1336 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (macos-latest, nightly)

In the use of ‘head’

Check warning on line 1336 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (macos-latest, nightly)

In the use of ‘head’

Check warning on line 1336 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (macos-latest, nightly)

In the use of ‘head’

Check warning on line 1336 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (macos-latest, nightly)

In the use of ‘head’

Check warning on line 1336 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (macos-13, 9.8.1)

In the use of ‘head’

Check warning on line 1336 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (macos-13, 9.8.1)

In the use of ‘head’
indentedWithFixedLevel 0 $ newlinePrefixed $ string <$> tail xs

Check warning on line 1337 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (ubuntu-latest, 9.8.1)

In the use of ‘tail’

Check warning on line 1337 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (ubuntu-latest, 9.8.1)

In the use of ‘tail’

Check warning on line 1337 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (windows-latest, 9.8.1)

In the use of ‘tail’

Check warning on line 1337 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (windows-latest, 9.8.1)

In the use of ‘tail’

Check warning on line 1337 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (macos-13, 9.8.1)

In the use of ‘tail’

Check warning on line 1337 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (macos-13, 9.8.1)

In the use of ‘tail’
pretty' (GHC.IEModuleContents _ name) =
pretty $ fmap ModuleNameWithPrefix name
pretty' GHC.IEGroup {} = docNode
Expand Down Expand Up @@ -1515,7 +1515,7 @@
pretty' (GHC.HsFloatPrim _ x) = pretty x >> string "#"
pretty' GHC.HsDoublePrim {} = notUsedInParsedStage
pretty' x =
case x of

Check warning on line 1518 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (ubuntu-latest, 8.10.7)

Pattern match(es) are non-exhaustive

Check warning on line 1518 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (ubuntu-latest, 9.4.8)

Pattern match(es) are non-exhaustive

Check warning on line 1518 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (ubuntu-latest, 9.8.1)

Pattern match(es) are non-exhaustive

Check warning on line 1518 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (ubuntu-latest, 9.6.4)

Pattern match(es) are non-exhaustive

Check warning on line 1518 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (macos-13, 8.10.7)

Pattern match(es) are non-exhaustive

Check warning on line 1518 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (windows-latest, 9.4.8)

Pattern match(es) are non-exhaustive

Check warning on line 1518 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (windows-latest, 9.6.4)

Pattern match(es) are non-exhaustive

Check warning on line 1518 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (macos-13, 9.4.8)

Pattern match(es) are non-exhaustive

Check warning on line 1518 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (windows-latest, 9.8.1)

Pattern match(es) are non-exhaustive

Check warning on line 1518 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (windows-latest, 8.10.7)

Pattern match(es) are non-exhaustive

Check warning on line 1518 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (macos-13, 9.6.4)

Pattern match(es) are non-exhaustive

Check warning on line 1518 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (macos-13, 9.8.1)

Pattern match(es) are non-exhaustive
GHC.HsString {} -> prettyString
GHC.HsStringPrim {} -> prettyString
where
Expand Down Expand Up @@ -1647,7 +1647,7 @@
string p |=> pretty (fmap StmtLRInsideVerticalList x)
newline
string "]"
stmtsAndPrefixes l = ("| ", head l) : fmap (", ", ) (tail l)

Check warning on line 1650 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (ubuntu-latest, 9.8.1)

In the use of ‘head’

Check warning on line 1650 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (ubuntu-latest, 9.8.1)

In the use of ‘tail’

Check warning on line 1650 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (ubuntu-latest, 9.8.1)

In the use of ‘head’

Check warning on line 1650 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (ubuntu-latest, 9.8.1)

In the use of ‘tail’

Check warning on line 1650 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (windows-latest, 9.8.1)

In the use of ‘head’

Check warning on line 1650 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (windows-latest, 9.8.1)

In the use of ‘tail’

Check warning on line 1650 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (windows-latest, 9.8.1)

In the use of ‘head’

Check warning on line 1650 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (windows-latest, 9.8.1)

In the use of ‘tail’

Check warning on line 1650 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (macos-13, 9.8.1)

In the use of ‘head’

Check warning on line 1650 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (macos-13, 9.8.1)

In the use of ‘tail’

Check warning on line 1650 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (macos-13, 9.8.1)

In the use of ‘head’

Check warning on line 1650 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (macos-13, 9.8.1)

In the use of ‘tail’

instance Pretty DoExpression where
pretty' DoExpression {..} = do
Expand Down Expand Up @@ -1685,14 +1685,6 @@
pretty' GHC.SrcLazy = string "~"
pretty' GHC.SrcStrict = string "!"
pretty' GHC.NoSrcStrict = pure ()

instance Pretty (GHC.HsOuterSigTyVarBndrs GHC.GhcPs) where
pretty' GHC.HsOuterImplicit {} = pure ()
pretty' GHC.HsOuterExplicit {..} = do
string "forall"
spacePrefixed
$ fmap (pretty . fmap mkTypeVariable . fromGenLocated) hso_bndrs
dot
#if MIN_VERSION_ghc_lib_parser(9,6,1)
instance Pretty GHC.FieldLabelString where
pretty' = output
Expand Down
3 changes: 0 additions & 3 deletions src/HIndent/Pretty.hs-boot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ module HIndent.Pretty
) where

import Data.Void
import qualified GHC.Core.Type as GHC
import qualified GHC.Types.Basic as GHC
import qualified GHC.Types.Name.Reader as GHC
import qualified GHC.Types.SourceText as GHC
Expand Down Expand Up @@ -44,8 +43,6 @@ instance Pretty

instance Pretty GHC.RdrName

instance Pretty (GHC.HsOuterTyVarBndrs GHC.Specificity GHc.GhcPs)

instance Pretty SigBindFamily

instance Pretty InfixOp
Expand Down
Loading