Language.PureScript.Linter.Imports

purescript-0.15.15: PureScript Programming Language Compiler

Safe Haskell | None
Language | Haskell2010

Language.PureScript.Linter.Imports

Synopsis

- lintImports :: MonadWriter MultipleErrors m => Module -> Env -> UsedImports -> m ()
- data Name
  - = IdentName Ident
  - | ValOpName (OpName 'ValueOpName)
  - | TyName (ProperName 'TypeName)
  - | TyOpName (OpName 'TypeOpName)
  - | DctorName (ProperName 'ConstructorName)
  - | TyClassName (ProperName 'ClassName)
  - | ModName ModuleName
- type UsedImports = Map ModuleName [Qualified Name]

# Documentation

lintImports :: MonadWriter MultipleErrors m => Module -> Env -> UsedImports -> m () #

Find and warn on:

- Unused import statements (qualified or unqualified)
- Unused references in an explicit import list
- Implicit imports of modules
- Implicit imports into a virtual module (unless the virtual module only has members from one module imported)
- Imports using `hiding` (this is another form of implicit importing)

data Name #

A sum of the possible name types, useful for error and lint messages.

Constructors

IdentName Ident |
ValOpName (OpName 'ValueOpName) |
TyName (ProperName 'TypeName) |
TyOpName (OpName 'TypeOpName) |
DctorName (ProperName 'ConstructorName) |
TyClassName (ProperName 'ClassName) |
ModName ModuleName |

#### Instances

Instances details

NFData Name # |
Instance details Defined in Language.PureScript.Names Methods rnf :: Name -> () #
Generic Name # |
Instance details Defined in Language.PureScript.Names Associated Types
type Rep Name |
Instance details Defined in Language.PureScript.Names type Rep Name = D1 ('MetaData "Name" "Language.PureScript.Names" "purescript-0.15.15-8K0LbmS63k4ILju2RsIrDp" 'False) ((C1 ('MetaCons "IdentName" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Ident)) :+: (C1 ('MetaCons "ValOpName" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (OpName 'ValueOpName))) :+: C1 ('MetaCons "TyName" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ProperName 'TypeName))))) :+: ((C1 ('MetaCons "TyOpName" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (OpName 'TypeOpName))) :+: C1 ('MetaCons "DctorName" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ProperName 'ConstructorName)))) :+: (C1 ('MetaCons "TyClassName" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ProperName 'ClassName))) :+: C1 ('MetaCons "ModName" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ModuleName)))))
Methods from :: Name -> Rep Name x # to :: Rep Name x -> Name #
Show Name # |
Instance details Defined in Language.PureScript.Names Methods showsPrec :: Int -> Name -> ShowS # show :: Name -> String # showList :: [Name] -> ShowS #
Eq Name # |
Instance details Defined in Language.PureScript.Names Methods (==) :: Name -> Name -> Bool # (/=) :: Name -> Name -> Bool #
Ord Name # |
Instance details Defined in Language.PureScript.Names Methods compare :: Name -> Name -> Ordering # (<) :: Name -> Name -> Bool # (<=) :: Name -> Name -> Bool # (>) :: Name -> Name -> Bool # (>=) :: Name -> Name -> Bool # max :: Name -> Name -> Name # min :: Name -> Name -> Name #
Serialise Name # |
Instance details Defined in Language.PureScript.Names Methods encode :: Name -> Encoding # decode :: Decoder s Name # encodeList :: [Name] -> Encoding # decodeList :: Decoder s [Name] #
type Rep Name # |
Instance details Defined in Language.PureScript.Names type Rep Name = D1 ('MetaData "Name" "Language.PureScript.Names" "purescript-0.15.15-8K0LbmS63k4ILju2RsIrDp" 'False) ((C1 ('MetaCons "IdentName" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Ident)) :+: (C1 ('MetaCons "ValOpName" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (OpName 'ValueOpName))) :+: C1 ('MetaCons "TyName" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ProperName 'TypeName))))) :+: ((C1 ('MetaCons "TyOpName" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (OpName 'TypeOpName))) :+: C1 ('MetaCons "DctorName" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ProperName 'ConstructorName)))) :+: (C1 ('MetaCons "TyClassName" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ProperName 'ClassName))) :+: C1 ('MetaCons "ModName" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ModuleName)))))

type UsedImports = Map ModuleName [Qualified Name] #

Map of module name to list of imported names from that module which have been used.