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

Implement DefaultDeclaration #871

Merged
merged 1 commit into from
Apr 12, 2024
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
1 change: 1 addition & 0 deletions hindent.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ library
HIndent.Ast.Declaration.Data.Haskell98.Constructor.Body
HIndent.Ast.Declaration.Data.Header
HIndent.Ast.Declaration.Data.NewOrData
HIndent.Ast.Declaration.Default
HIndent.Ast.Declaration.Family.Data
HIndent.Ast.Declaration.Family.Type
HIndent.Ast.Declaration.Family.Type.Injectivity
Expand Down
9 changes: 5 additions & 4 deletions src/HIndent/Ast/Declaration.hs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import Data.Maybe
import HIndent.Ast.Declaration.Bind
import HIndent.Ast.Declaration.Class
import HIndent.Ast.Declaration.Data
import HIndent.Ast.Declaration.Default
import HIndent.Ast.Declaration.Family.Data
import HIndent.Ast.Declaration.Family.Type
import HIndent.Ast.Declaration.Instance.Class
Expand Down Expand Up @@ -38,7 +39,7 @@ data Declaration
| Bind Bind
| Signature Signature
| StandaloneKindSignature StandaloneKind
| DefDecl (GHC.DefaultDecl GHC.GhcPs)
| Default DefaultDeclaration
| ForDecl (GHC.ForeignDecl GHC.GhcPs)
| WarningDecl (GHC.WarnDecls GHC.GhcPs)
| AnnDecl (GHC.AnnDecl GHC.GhcPs)
Expand All @@ -59,7 +60,7 @@ instance CommentExtraction Declaration where
nodeComments Bind {} = NodeComments [] [] []
nodeComments Signature {} = NodeComments [] [] []
nodeComments StandaloneKindSignature {} = NodeComments [] [] []
nodeComments DefDecl {} = NodeComments [] [] []
nodeComments Default {} = NodeComments [] [] []
nodeComments ForDecl {} = NodeComments [] [] []
nodeComments WarningDecl {} = NodeComments [] [] []
nodeComments AnnDecl {} = NodeComments [] [] []
Expand All @@ -80,7 +81,7 @@ instance Pretty Declaration where
pretty' (Bind x) = pretty x
pretty' (Signature x) = pretty x
pretty' (StandaloneKindSignature x) = pretty x
pretty' (DefDecl x) = pretty x
pretty' (Default x) = pretty x
pretty' (ForDecl x) = pretty x
pretty' (WarningDecl x) = pretty x
pretty' (AnnDecl x) = pretty x
Expand All @@ -107,7 +108,7 @@ mkDeclaration (GHC.DerivD _ x) = StandAloneDeriving $ mkStandAloneDeriving x
mkDeclaration (GHC.ValD _ x) = Bind $ mkBind x
mkDeclaration (GHC.SigD _ x) = Signature $ mkSignature x
mkDeclaration (GHC.KindSigD _ x) = StandaloneKindSignature $ mkStandaloneKind x
mkDeclaration (GHC.DefD _ x) = DefDecl x
mkDeclaration (GHC.DefD _ x) = Default $ mkDefaultDeclaration x
mkDeclaration (GHC.ForD _ x) = ForDecl x
mkDeclaration (GHC.WarningD _ x) = WarningDecl x
mkDeclaration (GHC.AnnD _ x) = AnnDecl x
Expand Down
23 changes: 23 additions & 0 deletions src/HIndent/Ast/Declaration/Default.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
module HIndent.Ast.Declaration.Default
( DefaultDeclaration
, mkDefaultDeclaration
) where

import qualified GHC.Hs as GHC
import HIndent.Ast.NodeComments
import {-# SOURCE #-} HIndent.Pretty
import HIndent.Pretty.Combinators
import HIndent.Pretty.NodeComments

newtype DefaultDeclaration =
DefaultDeclaration [GHC.LHsType GHC.GhcPs]

instance CommentExtraction DefaultDeclaration where
nodeComments DefaultDeclaration {} = NodeComments [] [] []

instance Pretty DefaultDeclaration where
pretty' (DefaultDeclaration xs) =
spaced [string "default", hTuple $ fmap pretty xs]

mkDefaultDeclaration :: GHC.DefaultDecl GHC.GhcPs -> DefaultDeclaration
mkDefaultDeclaration (GHC.DefaultDecl _ xs) = DefaultDeclaration xs
4 changes: 0 additions & 4 deletions src/HIndent/Pretty.hs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,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 61 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 61 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 61 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 61 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 61 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (macos-latest, 9.4.8)

The qualified import of ‘Data.Foldable’ is redundant

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

View workflow job for this annotation

GitHub Actions / CI (macos-latest, 9.4.8)

The qualified import of ‘Data.Foldable’ is redundant

Check warning on line 61 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 61 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 61 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 61 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 61 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (macos-latest, 9.2.8)

The qualified import of ‘Data.Foldable’ is redundant

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

View workflow job for this annotation

GitHub Actions / CI (macos-latest, 9.2.8)

The qualified import of ‘Data.Foldable’ is redundant

Check warning on line 61 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 61 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 61 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 61 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 61 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 61 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 61 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 61 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 61 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 61 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 61 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 61 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 61 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (macos-latest, 9.6.4)

The qualified import of ‘Data.Foldable’ is redundant

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

View workflow job for this annotation

GitHub Actions / CI (macos-latest, 9.6.4)

The qualified import of ‘Data.Foldable’ is redundant

Check warning on line 61 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 61 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 61 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 61 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 61 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 61 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 61 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 61 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 61 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (macos-latest, 9.8.1)

The qualified import of ‘Data.Foldable’ is redundant

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

View workflow job for this annotation

GitHub Actions / CI (macos-latest, 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 @@ -548,7 +548,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 551 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 551 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 551 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 551 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 551 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 551 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 551 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 551 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 551 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 551 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 551 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 551 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 551 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 551 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 551 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 551 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 551 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (macos-latest, 9.8.1)

In the use of ‘head’

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

View workflow job for this annotation

GitHub Actions / CI (macos-latest, 9.8.1)

In the use of ‘head’
GHC.LazyPat {} -> space
GHC.BangPat {} -> space
_ -> return ()
Expand Down Expand Up @@ -587,7 +587,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 590 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 590 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 590 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 590 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 590 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 590 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 590 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 590 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 590 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 590 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 590 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 590 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 590 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 590 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 590 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 590 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 590 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (macos-latest, 9.8.1)

In the use of ‘head’

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

View workflow job for this annotation

GitHub Actions / CI (macos-latest, 9.8.1)

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

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

Check warning on line 1234 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 1234 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (macos-latest, 9.4.8)

Pattern match(es) are non-exhaustive

Check warning on line 1234 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 1234 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 1234 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 1234 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 1234 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 1234 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 1234 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 1234 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 1234 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 1234 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (macos-latest, 9.6.4)

Pattern match(es) are non-exhaustive

Check warning on line 1234 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 1234 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 1234 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 1234 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 1234 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 1234 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 1234 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 1234 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 1234 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (macos-latest, 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 @@ -1348,8 +1348,8 @@
[] -> pure ()
[x'] -> string x'
xs -> do
string $ head xs

Check warning on line 1351 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 1351 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 1351 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 1351 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 1351 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 1351 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 1351 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 1351 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 1351 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 1351 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 1351 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 1351 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 1351 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 1351 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 1351 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 1351 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 1351 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (macos-latest, 9.8.1)

In the use of ‘head’

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

View workflow job for this annotation

GitHub Actions / CI (macos-latest, 9.8.1)

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

Check warning on line 1352 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 1352 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 1352 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 1352 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 1352 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (macos-latest, 9.8.1)

In the use of ‘tail’

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

View workflow job for this annotation

GitHub Actions / CI (macos-latest, 9.8.1)

In the use of ‘tail’
pretty' (GHC.IEModuleContents _ name) =
pretty $ fmap ModuleNameWithPrefix name
pretty' GHC.IEGroup {} = docNode
Expand Down Expand Up @@ -1545,10 +1545,6 @@
(GHC.GenLocated GHC.SrcSpanAnnA (GHC.HsType GHC.GhcPs))) where
pretty' GHC.HsWC {..} = pretty hswc_body

instance Pretty (GHC.DefaultDecl GHC.GhcPs) where
pretty' (GHC.DefaultDecl _ xs) =
spaced [string "default", hTuple $ fmap pretty xs]

instance Pretty (GHC.ForeignDecl GHC.GhcPs) where
pretty' GHC.ForeignImport {..} =
spaced
Expand Down Expand Up @@ -1697,7 +1693,7 @@
pretty' (GHC.HsFloatPrim _ x) = pretty x >> string "#"
pretty' GHC.HsDoublePrim {} = notUsedInParsedStage
pretty' x =
case x of

Check warning on line 1696 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 1696 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (macos-latest, 9.4.8)

Pattern match(es) are non-exhaustive

Check warning on line 1696 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 1696 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 1696 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 1696 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 1696 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 1696 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 1696 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 1696 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (macos-latest, 9.6.4)

Pattern match(es) are non-exhaustive

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

View workflow job for this annotation

GitHub Actions / CI (macos-latest, 8.10.7)

Pattern match(es) are non-exhaustive

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

View workflow job for this annotation

GitHub Actions / CI (macos-latest, 9.8.1)

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

Check warning on line 1828 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 1828 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 1828 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 1828 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 1828 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 1828 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 1828 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 1828 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 1828 in src/HIndent/Pretty.hs

View workflow job for this annotation

GitHub Actions / CI (macos-latest, 9.8.1)

In the use of ‘head’

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

View workflow job for this annotation

GitHub Actions / CI (macos-latest, 9.8.1)

In the use of ‘tail’

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

View workflow job for this annotation

GitHub Actions / CI (macos-latest, 9.8.1)

In the use of ‘head’

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

View workflow job for this annotation

GitHub Actions / CI (macos-latest, 9.8.1)

In the use of ‘tail’

instance Pretty DoExpression where
pretty' DoExpression {..} = do
Expand Down
2 changes: 0 additions & 2 deletions src/HIndent/Pretty.hs-boot
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ instance Pretty (GHC.HsPatSynDir GHC.GhcPs)

instance Pretty PatInsidePatDecl

instance Pretty (GHC.DefaultDecl GHc.GhcPs)

instance Pretty (GHC.ForeignDecl GHC.GhcPs)

instance Pretty (GHC.WarnDecls GHC.GhcPs)
Expand Down
Loading