stan-0.2.0.0: Haskell STatic ANalyser

Copyright | (c) 2020 Kowainik
License | MPL-2.0
Maintainer | Kowainik <xrom.xkov@gmail.com>
Safe Haskell | None
Language | Haskell2010

Stan.NameMeta

Contents

- Pretty show
- Comparison with `Name`
- Smart constructors

Description

Data types and functions for working with meta information.

Synopsis

- data NameMeta = NameMeta {
  - nameMetaPackage :: !Text
  - nameMetaModuleName :: !ModuleName
  - nameMetaName :: !Text
  }
- prettyShowNameMeta :: NameMeta -> Text
- compareNames :: NameMeta -> Name -> Bool
- hieMatchNameMeta :: NameMeta -> (Identifier, IdentifierDetails TypeIndex) -> Bool
- hieFindIdentifier :: NameMeta -> HieAST TypeIndex -> Maybe NameMeta
- baseNameFrom :: Text -> ModuleName -> NameMeta
- ghcInternalNameFrom :: Text -> ModuleName -> NameMeta
- _nameFrom :: Text -> ModuleName -> NameMeta
- mkBaseListMeta :: Text -> NameMeta
- mkBaseOldListMeta :: Text -> NameMeta
- mkBaseFoldableMeta :: Text -> NameMeta
- unorderedNameFrom :: Text -> ModuleName -> NameMeta
- textNameFrom :: Text -> ModuleName -> NameMeta
- ghcPrimNameFrom :: Text -> ModuleName -> NameMeta
- primTypeMeta :: Text -> NameMeta

# Documentation

data NameMeta #

Meta information about function/type.

Constructors

NameMeta |
Fields nameMetaPackage :: !Text nameMetaModuleName :: !ModuleName nameMetaName :: !Text

#### Instances

Instances details

Show NameMeta # |
Instance details Defined in Stan.NameMeta Methods showsPrec :: Int -> NameMeta -> ShowS # show :: NameMeta -> String # showList :: [NameMeta] -> ShowS #
Eq NameMeta # |
Instance details Defined in Stan.NameMeta Methods (==) :: NameMeta -> NameMeta -> Bool # (/=) :: NameMeta -> NameMeta -> Bool #

# Pretty show

prettyShowNameMeta :: NameMeta -> Text #

Pretty show `NameMeta` in the following format: `package/module/name`.

# Comparison with `Name`

compareNames :: NameMeta -> Name -> Bool #

Check if `NameMeta` is identical to `Name`.

hieMatchNameMeta #

Arguments

:: NameMeta | Name meta info
-> (Identifier, IdentifierDetails TypeIndex) | HIE identifier
-> Bool |

Check whether HIE `Identifier` with details is a given `NameMeta`.

hieFindIdentifier :: NameMeta -> HieAST TypeIndex -> Maybe NameMeta #

Check if the given `HieAST` node is identifier equal to the given `NameMeta`.

# Smart constructors

baseNameFrom :: Text -> ModuleName -> NameMeta infix 8 #

Create `NameMeta` for a function from the `base` package and a given `ModuleName`. module.

ghcInternalNameFrom :: Text -> ModuleName -> NameMeta infix 8 #

_nameFrom :: Text -> ModuleName -> NameMeta #

mkBaseListMeta :: Text -> NameMeta #

Create `NameMeta` for a function from the `base` package and the GHC.List module.

mkBaseOldListMeta :: Text -> NameMeta #

Create `NameMeta` for a function from the `base` package and the Data.OldList module.

mkBaseFoldableMeta :: Text -> NameMeta #

Create `NameMeta` for a function from the `base` package and the Data.Foldable module.

unorderedNameFrom :: Text -> ModuleName -> NameMeta infix 8 #

Create `NameMeta` for a function from the `unordered-containers` package and a given `ModuleName` module.

textNameFrom :: Text -> ModuleName -> NameMeta infix 8 #

Create `NameMeta` for a function from the `text` package and a given `ModuleName` module.

ghcPrimNameFrom :: Text -> ModuleName -> NameMeta infix 8 #

Create `NameMeta` for a function from the `ghc-prim` package and a given `ModuleName` module.

primTypeMeta :: Text -> NameMeta #

`NameMeta` for primitive types.