stan-0.1.2.1: Haskell STatic ANalyser

Safe Haskell | None
Language | Haskell2010

Stan.Hie.Compat

Synopsis

- data HieAST a = Node {
  - sourcedNodeInfo :: SourcedNodeInfo a
  - nodeSpan :: Span
  - nodeChildren :: [HieAST a]
  }
- data IEType
  - = Import
  - | ImportAs
  - | ImportHiding
  - | Export
- newtype DeclType = DeclType DeclType
- data ContextInfo
  - = Use
  - | MatchBind
  - | IEThing IEType
  - | TyDecl
  - | ValBind BindType Scope (Maybe Span)
  - | PatternBind Scope Scope (Maybe Span)
  - | ClassTyDecl (Maybe Span)
  - | Decl DeclType (Maybe Span)
  - | TyVarBind Scope TyVarScope
  - | RecField RecFieldContext (Maybe Span)
  - | EvidenceVarBind EvVarSource Scope (Maybe Span)
  - | EvidenceVarUse
- data IdentifierDetails a = IdentifierDetails {
  - identType :: Maybe a
  - identInfo :: Set ContextInfo
  }
- type Identifier = Either ModuleName Name
- data NodeInfo a = NodeInfo {
  - nodeAnnotations :: Set NodeAnnotation
  - nodeType :: [a]
  - nodeIdentifiers :: NodeIdentifiers a
  }
- data NodeAnnotation
- newtype HieASTs a = HieASTs {
  - getAsts :: Map HiePath (HieAST a)
  }
- newtype HieArgs a = HieArgs [(Bool, a)]
- type HieTypeFlat = HieType TypeIndex
- data HieType a
  - = HTyVarTy Name
  - | HAppTy a (HieArgs a)
  - | HTyConApp IfaceTyCon (HieArgs a)
  - | HForAllTy ((Name, a), ForAllTyFlag) a
  - | HFunTy a a a
  - | HQualTy a a
  - | HLitTy IfaceTyLit
  - | HCastTy a
  - | HCoercionTy
- type TypeIndex = Int
- data HieFile = HieFile {
  - hie_hs_file :: FilePath
  - hie_module :: Module
  - hie_types :: Array TypeIndex HieTypeFlat
  - hie_asts :: HieASTs TypeIndex
  - hie_exports :: [AvailInfo]
  - hie_hs_src :: ByteString
  }
- nodeInfo :: Ord a => HieAST a -> NodeInfo a
- data HieFileResult
- readHieFileWithNameCache :: IO (FilePath -> IO HieFileResult)
- toNodeAnnotation :: NodeAnnotation -> NodeAnnotation
- eqDeclType :: DeclType -> DeclType -> Bool
- hFunTy2 :: HieType b -> Maybe (b, b)
- mkNodeAnnotation :: FastString -> FastString -> NodeAnnotation
- conDec :: DeclType

# Documentation

data HieAST a #

Constructors

Node |

Fields

- sourcedNodeInfo :: SourcedNodeInfo a
- nodeSpan :: Span
- nodeChildren :: [HieAST a]

#### Instances

Instances details

Foldable HieAST |

Instance details

Defined in GHC.Iface.Ext.Types

Methods

fold :: Monoid m => HieAST m -> m #

foldMap :: Monoid m => (a -> m) -> HieAST a -> m #

foldMap' :: Monoid m => (a -> m) -> HieAST a -> m #

foldr :: (a -> b -> b) -> b -> HieAST a -> b #

foldr' :: (a -> b -> b) -> b -> HieAST a -> b #

foldl :: (b -> a -> b) -> b -> HieAST a -> b #

foldl' :: (b -> a -> b) -> b -> HieAST a -> b #

foldr1 :: (a -> a -> a) -> HieAST a -> a #

foldl1 :: (a -> a -> a) -> HieAST a -> a #

toList :: HieAST a -> [a] #

null :: HieAST a -> Bool #

length :: HieAST a -> Int #

elem :: Eq a => a -> HieAST a -> Bool #

maximum :: Ord a => HieAST a -> a #

minimum :: Ord a => HieAST a -> a #

sum :: Num a => HieAST a -> a #

product :: Num a => HieAST a -> a #

Traversable HieAST |
Instance details Defined in GHC.Iface.Ext.Types Methods traverse :: Applicative f => (a -> f b) -> HieAST a -> f (HieAST b) # sequenceA :: Applicative f => HieAST (f a) -> f (HieAST a) # mapM :: Monad m => (a -> m b) -> HieAST a -> m (HieAST b) # sequence :: Monad m => HieAST (m a) -> m (HieAST a) #
Functor HieAST |
Instance details Defined in GHC.Iface.Ext.Types Methods fmap :: (a -> b) -> HieAST a -> HieAST b # (<$) :: a -> HieAST b -> HieAST a #
Show a => Show (HieAST a) # |
Instance details Defined in Stan.Hie.Debug908 Methods showsPrec :: Int -> HieAST a -> ShowS # show :: HieAST a -> String # showList :: [HieAST a] -> ShowS #
Binary (HieAST TypeIndex) |
Instance details Defined in GHC.Iface.Ext.Types Methods put_ :: BinHandle -> HieAST TypeIndex -> IO () # put :: BinHandle -> HieAST TypeIndex -> IO (Bin (HieAST TypeIndex)) # get :: BinHandle -> IO (HieAST TypeIndex) #
Outputable a => Outputable (HieAST a) |
Instance details Defined in GHC.Iface.Ext.Types Methods ppr :: HieAST a -> SDoc #

data IEType #

Types of imports and exports

Constructors

Import |
ImportAs |
ImportHiding |
Export |

#### Instances

Instances details

Enum IEType |
Instance details Defined in GHC.Iface.Ext.Types Methods succ :: IEType -> IEType # pred :: IEType -> IEType # toEnum :: Int -> IEType # fromEnum :: IEType -> Int # enumFrom :: IEType -> [IEType] # enumFromThen :: IEType -> IEType -> [IEType] # enumFromTo :: IEType -> IEType -> [IEType] # enumFromThenTo :: IEType -> IEType -> IEType -> [IEType] #
Show IEType # |
Instance details Defined in Stan.Hie.Debug908 Methods showsPrec :: Int -> IEType -> ShowS # show :: IEType -> String # showList :: [IEType] -> ShowS #
Binary IEType |
Instance details Defined in GHC.Iface.Ext.Types Methods put_ :: BinHandle -> IEType -> IO () # put :: BinHandle -> IEType -> IO (Bin IEType) # get :: BinHandle -> IO IEType #
Outputable IEType |
Instance details Defined in GHC.Iface.Ext.Types Methods ppr :: IEType -> SDoc #
Eq IEType |
Instance details Defined in GHC.Iface.Ext.Types Methods (==) :: IEType -> IEType -> Bool # (/=) :: IEType -> IEType -> Bool #
Ord IEType |
Instance details Defined in GHC.Iface.Ext.Types Methods compare :: IEType -> IEType -> Ordering # (<) :: IEType -> IEType -> Bool # (<=) :: IEType -> IEType -> Bool # (>) :: IEType -> IEType -> Bool # (>=) :: IEType -> IEType -> Bool # max :: IEType -> IEType -> IEType # min :: IEType -> IEType -> IEType #

newtype DeclType #

Constructors

DeclType DeclType |

#### Instances

Instances details

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

data ContextInfo #

Different contexts under which identifiers exist

Constructors

Use | regular variable
MatchBind |
IEThing IEType | import/export
TyDecl |
ValBind | Value binding

Fields

- BindType

  whether or not the binding is in an instance

- Scope

  scope over which the value is bound

- (Maybe Span)

  span of entire binding

PatternBind

Pattern binding

This case is tricky because the bound identifier can be used in two distinct scopes. Consider the following example (with `-XViewPatterns`)

    do (b, a, (a -> True)) <- bar
       foo a

The identifier `a` has two scopes: in the view pattern `(a -> True)` and in the rest of the `do`-block in `foo a`.

Fields

- Scope

  scope in the pattern (the variable bound can be used further in the pattern)

- Scope

  rest of the scope outside the pattern

- (Maybe Span)

  span of entire binding

ClassTyDecl (Maybe Span) |
Decl | Declaration

Fields

- DeclType

  type of declaration

- (Maybe Span)

  span of entire binding

TyVarBind Scope TyVarScope | Type variable
RecField RecFieldContext (Maybe Span) | Record field
EvidenceVarBind | Constraint/Dictionary evidence variable binding

Fields

- EvVarSource

  how did this bind come into being

- Scope

  scope over which the value is bound

- (Maybe Span)

  span of the binding site

EvidenceVarUse | Usage of evidence variable

#### Instances

Instances details

Show ContextInfo # |
Instance details Defined in Stan.Hie.Debug908 Methods showsPrec :: Int -> ContextInfo -> ShowS # show :: ContextInfo -> String # showList :: [ContextInfo] -> ShowS #
Binary ContextInfo |
Instance details Defined in GHC.Iface.Ext.Types Methods put_ :: BinHandle -> ContextInfo -> IO () # put :: BinHandle -> ContextInfo -> IO (Bin ContextInfo) # get :: BinHandle -> IO ContextInfo #
Outputable ContextInfo |
Instance details Defined in GHC.Iface.Ext.Types Methods ppr :: ContextInfo -> SDoc #
Eq ContextInfo |
Instance details Defined in GHC.Iface.Ext.Types Methods (==) :: ContextInfo -> ContextInfo -> Bool # (/=) :: ContextInfo -> ContextInfo -> Bool #
Ord ContextInfo |
Instance details Defined in GHC.Iface.Ext.Types Methods compare :: ContextInfo -> ContextInfo -> Ordering # (<) :: ContextInfo -> ContextInfo -> Bool # (<=) :: ContextInfo -> ContextInfo -> Bool # (>) :: ContextInfo -> ContextInfo -> Bool # (>=) :: ContextInfo -> ContextInfo -> Bool # max :: ContextInfo -> ContextInfo -> ContextInfo # min :: ContextInfo -> ContextInfo -> ContextInfo #

data IdentifierDetails a #

Information associated with every identifier

We need to include types with identifiers because sometimes multiple identifiers occur in the same span(Overloaded Record Fields and so on)

Constructors

IdentifierDetails |

Fields

- identType :: Maybe a
- identInfo :: Set ContextInfo

#### Instances

Instances details

Foldable IdentifierDetails |

Instance details

Defined in GHC.Iface.Ext.Types

Methods

fold :: Monoid m => IdentifierDetails m -> m #

foldMap :: Monoid m => (a -> m) -> IdentifierDetails a -> m #

foldMap' :: Monoid m => (a -> m) -> IdentifierDetails a -> m #

foldr :: (a -> b -> b) -> b -> IdentifierDetails a -> b #

foldr' :: (a -> b -> b) -> b -> IdentifierDetails a -> b #

foldl :: (b -> a -> b) -> b -> IdentifierDetails a -> b #

foldl' :: (b -> a -> b) -> b -> IdentifierDetails a -> b #

foldr1 :: (a -> a -> a) -> IdentifierDetails a -> a #

foldl1 :: (a -> a -> a) -> IdentifierDetails a -> a #

toList :: IdentifierDetails a -> [a] #

null :: IdentifierDetails a -> Bool #

length :: IdentifierDetails a -> Int #

elem :: Eq a => a -> IdentifierDetails a -> Bool #

maximum :: Ord a => IdentifierDetails a -> a #

minimum :: Ord a => IdentifierDetails a -> a #

sum :: Num a => IdentifierDetails a -> a #

product :: Num a => IdentifierDetails a -> a #

Traversable IdentifierDetails |
Instance details Defined in GHC.Iface.Ext.Types Methods traverse :: Applicative f => (a -> f b) -> IdentifierDetails a -> f (IdentifierDetails b) # sequenceA :: Applicative f => IdentifierDetails (f a) -> f (IdentifierDetails a) # mapM :: Monad m => (a -> m b) -> IdentifierDetails a -> m (IdentifierDetails b) # sequence :: Monad m => IdentifierDetails (m a) -> m (IdentifierDetails a) #
Functor IdentifierDetails |
Instance details Defined in GHC.Iface.Ext.Types Methods fmap :: (a -> b) -> IdentifierDetails a -> IdentifierDetails b # (<$) :: a -> IdentifierDetails b -> IdentifierDetails a #
Monoid (IdentifierDetails a) |
Instance details Defined in GHC.Iface.Ext.Types Methods mempty :: IdentifierDetails a # mappend :: IdentifierDetails a -> IdentifierDetails a -> IdentifierDetails a # mconcat :: [IdentifierDetails a] -> IdentifierDetails a #
Semigroup (IdentifierDetails a) |
Instance details Defined in GHC.Iface.Ext.Types Methods (<>) :: IdentifierDetails a -> IdentifierDetails a -> IdentifierDetails a # sconcat :: NonEmpty (IdentifierDetails a) -> IdentifierDetails a # stimes :: Integral b => b -> IdentifierDetails a -> IdentifierDetails a #
Show a => Show (IdentifierDetails a) # |
Instance details Defined in Stan.Hie.Debug908 Methods showsPrec :: Int -> IdentifierDetails a -> ShowS # show :: IdentifierDetails a -> String # showList :: [IdentifierDetails a] -> ShowS #
Binary (IdentifierDetails TypeIndex) |
Instance details Defined in GHC.Iface.Ext.Types Methods put_ :: BinHandle -> IdentifierDetails TypeIndex -> IO () # put :: BinHandle -> IdentifierDetails TypeIndex -> IO (Bin (IdentifierDetails TypeIndex)) # get :: BinHandle -> IO (IdentifierDetails TypeIndex) #
Outputable a => Outputable (IdentifierDetails a) |
Instance details Defined in GHC.Iface.Ext.Types Methods ppr :: IdentifierDetails a -> SDoc #
Eq a => Eq (IdentifierDetails a) |
Instance details Defined in GHC.Iface.Ext.Types Methods (==) :: IdentifierDetails a -> IdentifierDetails a -> Bool # (/=) :: IdentifierDetails a -> IdentifierDetails a -> Bool #

type Identifier = Either ModuleName Name #

data NodeInfo a #

The information stored in one AST node.

The type parameter exists to provide flexibility in representation of types (see Note [Efficient serialization of redundant type info]).

Constructors

NodeInfo |

Fields

- nodeAnnotations :: Set NodeAnnotation

  Annotations

- nodeType :: [a]

  The Haskell types of this node, if any.

- nodeIdentifiers :: NodeIdentifiers a

  All the identifiers and their details

#### Instances

Instances details

Foldable NodeInfo |

Instance details

Defined in GHC.Iface.Ext.Types

Methods

fold :: Monoid m => NodeInfo m -> m #

foldMap :: Monoid m => (a -> m) -> NodeInfo a -> m #

foldMap' :: Monoid m => (a -> m) -> NodeInfo a -> m #

foldr :: (a -> b -> b) -> b -> NodeInfo a -> b #

foldr' :: (a -> b -> b) -> b -> NodeInfo a -> b #

foldl :: (b -> a -> b) -> b -> NodeInfo a -> b #

foldl' :: (b -> a -> b) -> b -> NodeInfo a -> b #

foldr1 :: (a -> a -> a) -> NodeInfo a -> a #

foldl1 :: (a -> a -> a) -> NodeInfo a -> a #

toList :: NodeInfo a -> [a] #

null :: NodeInfo a -> Bool #

length :: NodeInfo a -> Int #

elem :: Eq a => a -> NodeInfo a -> Bool #

maximum :: Ord a => NodeInfo a -> a #

minimum :: Ord a => NodeInfo a -> a #

sum :: Num a => NodeInfo a -> a #

product :: Num a => NodeInfo a -> a #

Traversable NodeInfo |
Instance details Defined in GHC.Iface.Ext.Types Methods traverse :: Applicative f => (a -> f b) -> NodeInfo a -> f (NodeInfo b) # sequenceA :: Applicative f => NodeInfo (f a) -> f (NodeInfo a) # mapM :: Monad m => (a -> m b) -> NodeInfo a -> m (NodeInfo b) # sequence :: Monad m => NodeInfo (m a) -> m (NodeInfo a) #
Functor NodeInfo |
Instance details Defined in GHC.Iface.Ext.Types Methods fmap :: (a -> b) -> NodeInfo a -> NodeInfo b # (<$) :: a -> NodeInfo b -> NodeInfo a #
Show a => Show (NodeInfo a) # |
Instance details Defined in Stan.Hie.Debug908 Methods showsPrec :: Int -> NodeInfo a -> ShowS # show :: NodeInfo a -> String # showList :: [NodeInfo a] -> ShowS #
Binary (NodeInfo TypeIndex) |
Instance details Defined in GHC.Iface.Ext.Types Methods put_ :: BinHandle -> NodeInfo TypeIndex -> IO () # put :: BinHandle -> NodeInfo TypeIndex -> IO (Bin (NodeInfo TypeIndex)) # get :: BinHandle -> IO (NodeInfo TypeIndex) #
Outputable a => Outputable (NodeInfo a) |
Instance details Defined in GHC.Iface.Ext.Types Methods ppr :: NodeInfo a -> SDoc #

data NodeAnnotation #

#### Instances

Instances details

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

Instance details

Defined in Stan.Hie.Compat904

Methods

compare :: NodeAnnotation -> NodeAnnotation -> Ordering #

(<) :: NodeAnnotation -> NodeAnnotation -> Bool #

(<=) :: NodeAnnotation -> NodeAnnotation -> Bool #

(>) :: NodeAnnotation -> NodeAnnotation -> Bool #

(>=) :: NodeAnnotation -> NodeAnnotation -> Bool #

max :: NodeAnnotation -> NodeAnnotation -> NodeAnnotation #

min :: NodeAnnotation -> NodeAnnotation -> NodeAnnotation #

newtype HieASTs a #

Mapping from filepaths to the corresponding AST

Constructors

HieASTs |

Fields

- getAsts :: Map HiePath (HieAST a)

#### Instances

Instances details

Foldable HieASTs |

Instance details

Defined in GHC.Iface.Ext.Types

Methods

fold :: Monoid m => HieASTs m -> m #

foldMap :: Monoid m => (a -> m) -> HieASTs a -> m #

foldMap' :: Monoid m => (a -> m) -> HieASTs a -> m #

foldr :: (a -> b -> b) -> b -> HieASTs a -> b #

foldr' :: (a -> b -> b) -> b -> HieASTs a -> b #

foldl :: (b -> a -> b) -> b -> HieASTs a -> b #

foldl' :: (b -> a -> b) -> b -> HieASTs a -> b #

foldr1 :: (a -> a -> a) -> HieASTs a -> a #

foldl1 :: (a -> a -> a) -> HieASTs a -> a #

toList :: HieASTs a -> [a] #

null :: HieASTs a -> Bool #

length :: HieASTs a -> Int #

elem :: Eq a => a -> HieASTs a -> Bool #

maximum :: Ord a => HieASTs a -> a #

minimum :: Ord a => HieASTs a -> a #

sum :: Num a => HieASTs a -> a #

product :: Num a => HieASTs a -> a #

Traversable HieASTs |
Instance details Defined in GHC.Iface.Ext.Types Methods traverse :: Applicative f => (a -> f b) -> HieASTs a -> f (HieASTs b) # sequenceA :: Applicative f => HieASTs (f a) -> f (HieASTs a) # mapM :: Monad m => (a -> m b) -> HieASTs a -> m (HieASTs b) # sequence :: Monad m => HieASTs (m a) -> m (HieASTs a) #
Functor HieASTs |
Instance details Defined in GHC.Iface.Ext.Types Methods fmap :: (a -> b) -> HieASTs a -> HieASTs b # (<$) :: a -> HieASTs b -> HieASTs a #
Show a => Show (HieASTs a) # |
Instance details Defined in Stan.Hie.Debug908 Methods showsPrec :: Int -> HieASTs a -> ShowS # show :: HieASTs a -> String # showList :: [HieASTs a] -> ShowS #
Binary (HieASTs TypeIndex) |
Instance details Defined in GHC.Iface.Ext.Types Methods put_ :: BinHandle -> HieASTs TypeIndex -> IO () # put :: BinHandle -> HieASTs TypeIndex -> IO (Bin (HieASTs TypeIndex)) # get :: BinHandle -> IO (HieASTs TypeIndex) #
Outputable a => Outputable (HieASTs a) |
Instance details Defined in GHC.Iface.Ext.Types Methods ppr :: HieASTs a -> SDoc #

newtype HieArgs a #

A list of type arguments along with their respective visibilities (ie. is this an argument that would return `True` for `isVisibleForAllTyFlag`?).

Constructors

HieArgs [(Bool, a)] |

#### Instances

Instances details

Foldable HieArgs |

Instance details

Defined in GHC.Iface.Ext.Types

Methods

fold :: Monoid m => HieArgs m -> m #

foldMap :: Monoid m => (a -> m) -> HieArgs a -> m #

foldMap' :: Monoid m => (a -> m) -> HieArgs a -> m #

foldr :: (a -> b -> b) -> b -> HieArgs a -> b #

foldr' :: (a -> b -> b) -> b -> HieArgs a -> b #

foldl :: (b -> a -> b) -> b -> HieArgs a -> b #

foldl' :: (b -> a -> b) -> b -> HieArgs a -> b #

foldr1 :: (a -> a -> a) -> HieArgs a -> a #

foldl1 :: (a -> a -> a) -> HieArgs a -> a #

toList :: HieArgs a -> [a] #

null :: HieArgs a -> Bool #

length :: HieArgs a -> Int #

elem :: Eq a => a -> HieArgs a -> Bool #

maximum :: Ord a => HieArgs a -> a #

minimum :: Ord a => HieArgs a -> a #

sum :: Num a => HieArgs a -> a #

product :: Num a => HieArgs a -> a #

Traversable HieArgs |
Instance details Defined in GHC.Iface.Ext.Types Methods traverse :: Applicative f => (a -> f b) -> HieArgs a -> f (HieArgs b) # sequenceA :: Applicative f => HieArgs (f a) -> f (HieArgs a) # mapM :: Monad m => (a -> m b) -> HieArgs a -> m (HieArgs b) # sequence :: Monad m => HieArgs (m a) -> m (HieArgs a) #
Functor HieArgs |
Instance details Defined in GHC.Iface.Ext.Types Methods fmap :: (a -> b) -> HieArgs a -> HieArgs b # (<$) :: a -> HieArgs b -> HieArgs a #
Show a => Show (HieArgs a) # |
Instance details Defined in Stan.Hie.Debug908 Methods showsPrec :: Int -> HieArgs a -> ShowS # show :: HieArgs a -> String # showList :: [HieArgs a] -> ShowS #
Binary (HieArgs TypeIndex) |
Instance details Defined in GHC.Iface.Ext.Types Methods put_ :: BinHandle -> HieArgs TypeIndex -> IO () # put :: BinHandle -> HieArgs TypeIndex -> IO (Bin (HieArgs TypeIndex)) # get :: BinHandle -> IO (HieArgs TypeIndex) #
Eq a => Eq (HieArgs a) |
Instance details Defined in GHC.Iface.Ext.Types Methods (==) :: HieArgs a -> HieArgs a -> Bool # (/=) :: HieArgs a -> HieArgs a -> Bool #

type HieTypeFlat = HieType TypeIndex #

data HieType a #

A flattened version of `Type`.

See Note [Efficient serialization of redundant type info]

Constructors

HTyVarTy Name |
HAppTy a (HieArgs a) |
HTyConApp IfaceTyCon (HieArgs a) |
HForAllTy ((Name, a), ForAllTyFlag) a |
HFunTy a a a |
HQualTy a a | type with constraint: `t1 => t2` (see `IfaceDFunTy`)
HLitTy IfaceTyLit |
HCastTy a |
HCoercionTy |

#### Instances

Instances details

Foldable HieType |

Instance details

Defined in GHC.Iface.Ext.Types

Methods

fold :: Monoid m => HieType m -> m #

foldMap :: Monoid m => (a -> m) -> HieType a -> m #

foldMap' :: Monoid m => (a -> m) -> HieType a -> m #

foldr :: (a -> b -> b) -> b -> HieType a -> b #

foldr' :: (a -> b -> b) -> b -> HieType a -> b #

foldl :: (b -> a -> b) -> b -> HieType a -> b #

foldl' :: (b -> a -> b) -> b -> HieType a -> b #

foldr1 :: (a -> a -> a) -> HieType a -> a #

foldl1 :: (a -> a -> a) -> HieType a -> a #

toList :: HieType a -> [a] #

null :: HieType a -> Bool #

length :: HieType a -> Int #

elem :: Eq a => a -> HieType a -> Bool #

maximum :: Ord a => HieType a -> a #

minimum :: Ord a => HieType a -> a #

sum :: Num a => HieType a -> a #

product :: Num a => HieType a -> a #

Traversable HieType |
Instance details Defined in GHC.Iface.Ext.Types Methods traverse :: Applicative f => (a -> f b) -> HieType a -> f (HieType b) # sequenceA :: Applicative f => HieType (f a) -> f (HieType a) # mapM :: Monad m => (a -> m b) -> HieType a -> m (HieType b) # sequence :: Monad m => HieType (m a) -> m (HieType a) #
Functor HieType |
Instance details Defined in GHC.Iface.Ext.Types Methods fmap :: (a -> b) -> HieType a -> HieType b # (<$) :: a -> HieType b -> HieType a #
Show a => Show (HieType a) # |
Instance details Defined in Stan.Hie.Debug908 Methods showsPrec :: Int -> HieType a -> ShowS # show :: HieType a -> String # showList :: [HieType a] -> ShowS #
Binary (HieType TypeIndex) |
Instance details Defined in GHC.Iface.Ext.Types Methods put_ :: BinHandle -> HieType TypeIndex -> IO () # put :: BinHandle -> HieType TypeIndex -> IO (Bin (HieType TypeIndex)) # get :: BinHandle -> IO (HieType TypeIndex) #
Eq a => Eq (HieType a) |
Instance details Defined in GHC.Iface.Ext.Types Methods (==) :: HieType a -> HieType a -> Bool # (/=) :: HieType a -> HieType a -> Bool #

type TypeIndex = Int #

data HieFile #

GHC builds up a wealth of information about Haskell source as it compiles it. `.hie` files are a way of persisting some of this information to disk so that external tools that need to work with haskell source don't need to parse, typecheck, and rename all over again. These files contain:

- a simplified AST

  - nodes are annotated with source positions and types
  - identifiers are annotated with scope information
- the raw bytes of the initial Haskell source

Besides saving compilation cycles, `.hie` files also offer a more stable interface than the GHC API.

Constructors

HieFile |

Fields

- hie_hs_file :: FilePath

  Initial Haskell source file path

- hie_module :: Module

  The module this HIE file is for

- hie_types :: Array TypeIndex HieTypeFlat

  Types referenced in the `hie_asts`.

  See Note [Efficient serialization of redundant type info]

- hie_asts :: HieASTs TypeIndex

  Type-annotated abstract syntax trees

- hie_exports :: [AvailInfo]

  The names that this module exports

- hie_hs_src :: ByteString

  Raw bytes of the initial Haskell source

#### Instances

Instances details

Show HieFile # |
Instance details Defined in Stan.Hie.Debug908 Methods showsPrec :: Int -> HieFile -> ShowS # show :: HieFile -> String # showList :: [HieFile] -> ShowS #
Binary HieFile |
Instance details Defined in GHC.Iface.Ext.Types Methods put_ :: BinHandle -> HieFile -> IO () # put :: BinHandle -> HieFile -> IO (Bin HieFile) # get :: BinHandle -> IO HieFile #

nodeInfo :: Ord a => HieAST a -> NodeInfo a #

data HieFileResult #

readHieFileWithNameCache :: IO (FilePath -> IO HieFileResult) #

toNodeAnnotation :: NodeAnnotation -> NodeAnnotation #

eqDeclType :: DeclType -> DeclType -> Bool #

hFunTy2 :: HieType b -> Maybe (b, b) #

mkNodeAnnotation :: FastString -> FastString -> NodeAnnotation #

conDec :: DeclType #