purescript-0.15.15: PureScript Programming Language Compiler

Safe Haskell | None
Language | Haskell2010

Language.PureScript.Externs

Description

This module generates code for "externs" files, i.e. files containing only foreign import declarations.

Synopsis

- data ExternsFile = ExternsFile {
  - efVersion :: Text
  - efModuleName :: ModuleName
  - efExports :: [DeclarationRef]
  - efImports :: [ExternsImport]
  - efFixities :: [ExternsFixity]
  - efTypeFixities :: [ExternsTypeFixity]
  - efDeclarations :: [ExternsDeclaration]
  - efSourceSpan :: SourceSpan
  }
- data ExternsImport = ExternsImport {
  - eiModule :: ModuleName
  - eiImportType :: ImportDeclarationType
  - eiImportedAs :: Maybe ModuleName
  }
- data ExternsFixity = ExternsFixity {
  - efAssociativity :: Associativity
  - efPrecedence :: Precedence
  - efOperator :: OpName 'ValueOpName
  - efAlias :: Qualified (Either Ident (ProperName 'ConstructorName))
  }
- data ExternsTypeFixity = ExternsTypeFixity {
  - efTypeAssociativity :: Associativity
  - efTypePrecedence :: Precedence
  - efTypeOperator :: OpName 'TypeOpName
  - efTypeAlias :: Qualified (ProperName 'TypeName)
  }
- data ExternsDeclaration
  - = EDType {
    - edTypeName :: ProperName 'TypeName
    - edTypeKind :: SourceType
    - edTypeDeclarationKind :: TypeKind
    }
  - | EDTypeSynonym {
    - edTypeSynonymName :: ProperName 'TypeName
    - edTypeSynonymArguments :: [(Text, Maybe SourceType)]
    - edTypeSynonymType :: SourceType
    }
  - | EDDataConstructor {
    - edDataCtorName :: ProperName 'ConstructorName
    - edDataCtorOrigin :: DataDeclType
    - edDataCtorTypeCtor :: ProperName 'TypeName
    - edDataCtorType :: SourceType
    - edDataCtorFields :: [Ident]
    }
  - | EDValue {
    - edValueName :: Ident
    - edValueType :: SourceType
    }
  - | EDClass {
    - edClassName :: ProperName 'ClassName
    - edClassTypeArguments :: [(Text, Maybe SourceType)]
    - edClassMembers :: [(Ident, SourceType)]
    - edClassConstraints :: [SourceConstraint]
    - edFunctionalDependencies :: [FunctionalDependency]
    - edIsEmpty :: Bool
    }
  - | EDInstance {
    - edInstanceClassName :: Qualified (ProperName 'ClassName)
    - edInstanceName :: Ident
    - edInstanceForAll :: [(Text, SourceType)]
    - edInstanceKinds :: [SourceType]
    - edInstanceTypes :: [SourceType]
    - edInstanceConstraints :: Maybe [SourceConstraint]
    - edInstanceChain :: Maybe ChainId
    - edInstanceChainIndex :: Integer
    - edInstanceNameSource :: NameSource
    - edInstanceSourceSpan :: SourceSpan
    }
- externsIsCurrentVersion :: ExternsFile -> Bool
- moduleToExternsFile :: Module -> Environment -> Map Ident Ident -> ExternsFile
- applyExternsFileToEnvironment :: ExternsFile -> Environment -> Environment
- externsFileName :: FilePath

# Documentation

data ExternsFile #

The data which will be serialized to an externs file

Constructors

ExternsFile |

Fields

- efVersion :: Text

  The externs version

- efModuleName :: ModuleName

  Module name

- efExports :: [DeclarationRef]

  List of module exports

- efImports :: [ExternsImport]

  List of module imports

- efFixities :: [ExternsFixity]

  List of operators and their fixities

- efTypeFixities :: [ExternsTypeFixity]

  List of type operators and their fixities

- efDeclarations :: [ExternsDeclaration]

  List of type and value declaration

- efSourceSpan :: SourceSpan

  Source span for error reporting

#### Instances

Instances details

NFData ExternsFile # |
Instance details Defined in Language.PureScript.Externs Methods rnf :: ExternsFile -> () #
Generic ExternsFile # |

Instance details

Defined in Language.PureScript.Externs

Associated Types

type Rep ExternsFile |

Instance details

Defined in Language.PureScript.Externs

type Rep ExternsFile = D1 ('MetaData "ExternsFile" "Language.PureScript.Externs" "purescript-0.15.15-8K0LbmS63k4ILju2RsIrDp" 'False) (C1 ('MetaCons "ExternsFile" 'PrefixI 'True) (((S1 ('MetaSel ('Just "efVersion") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "efModuleName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ModuleName)) :*: (S1 ('MetaSel ('Just "efExports") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [DeclarationRef]) :*: S1 ('MetaSel ('Just "efImports") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [ExternsImport]))) :*: ((S1 ('MetaSel ('Just "efFixities") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [ExternsFixity]) :*: S1 ('MetaSel ('Just "efTypeFixities") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [ExternsTypeFixity])) :*: (S1 ('MetaSel ('Just "efDeclarations") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [ExternsDeclaration]) :*: S1 ('MetaSel ('Just "efSourceSpan") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SourceSpan)))))

Methods

from :: ExternsFile -> Rep ExternsFile x #

to :: Rep ExternsFile x -> ExternsFile #

Show ExternsFile # |
Instance details Defined in Language.PureScript.Externs Methods showsPrec :: Int -> ExternsFile -> ShowS # show :: ExternsFile -> String # showList :: [ExternsFile] -> ShowS #
Serialise ExternsFile # |
Instance details Defined in Language.PureScript.Externs Methods encode :: ExternsFile -> Encoding # decode :: Decoder s ExternsFile # encodeList :: [ExternsFile] -> Encoding # decodeList :: Decoder s [ExternsFile] #
type Rep ExternsFile # |

Instance details

Defined in Language.PureScript.Externs

type Rep ExternsFile = D1 ('MetaData "ExternsFile" "Language.PureScript.Externs" "purescript-0.15.15-8K0LbmS63k4ILju2RsIrDp" 'False) (C1 ('MetaCons "ExternsFile" 'PrefixI 'True) (((S1 ('MetaSel ('Just "efVersion") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "efModuleName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ModuleName)) :*: (S1 ('MetaSel ('Just "efExports") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [DeclarationRef]) :*: S1 ('MetaSel ('Just "efImports") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [ExternsImport]))) :*: ((S1 ('MetaSel ('Just "efFixities") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [ExternsFixity]) :*: S1 ('MetaSel ('Just "efTypeFixities") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [ExternsTypeFixity])) :*: (S1 ('MetaSel ('Just "efDeclarations") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [ExternsDeclaration]) :*: S1 ('MetaSel ('Just "efSourceSpan") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SourceSpan)))))

data ExternsImport #

A module import in an externs file

Constructors

ExternsImport |

Fields

- eiModule :: ModuleName

  The imported module

- eiImportType :: ImportDeclarationType

  The import type: regular, qualified or hiding

- eiImportedAs :: Maybe ModuleName

  The imported-as name, for qualified imports

#### Instances

Instances details

NFData ExternsImport # |
Instance details Defined in Language.PureScript.Externs Methods rnf :: ExternsImport -> () #
Generic ExternsImport # |

Instance details

Defined in Language.PureScript.Externs

Associated Types

type Rep ExternsImport |

Instance details

Defined in Language.PureScript.Externs

type Rep ExternsImport = D1 ('MetaData "ExternsImport" "Language.PureScript.Externs" "purescript-0.15.15-8K0LbmS63k4ILju2RsIrDp" 'False) (C1 ('MetaCons "ExternsImport" 'PrefixI 'True) (S1 ('MetaSel ('Just "eiModule") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ModuleName) :*: (S1 ('MetaSel ('Just "eiImportType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ImportDeclarationType) :*: S1 ('MetaSel ('Just "eiImportedAs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe ModuleName)))))

Methods

from :: ExternsImport -> Rep ExternsImport x #

to :: Rep ExternsImport x -> ExternsImport #

Show ExternsImport # |
Instance details Defined in Language.PureScript.Externs Methods showsPrec :: Int -> ExternsImport -> ShowS # show :: ExternsImport -> String # showList :: [ExternsImport] -> ShowS #
Serialise ExternsImport # |
Instance details Defined in Language.PureScript.Externs Methods encode :: ExternsImport -> Encoding # decode :: Decoder s ExternsImport # encodeList :: [ExternsImport] -> Encoding # decodeList :: Decoder s [ExternsImport] #
type Rep ExternsImport # |

Instance details

Defined in Language.PureScript.Externs

type Rep ExternsImport = D1 ('MetaData "ExternsImport" "Language.PureScript.Externs" "purescript-0.15.15-8K0LbmS63k4ILju2RsIrDp" 'False) (C1 ('MetaCons "ExternsImport" 'PrefixI 'True) (S1 ('MetaSel ('Just "eiModule") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ModuleName) :*: (S1 ('MetaSel ('Just "eiImportType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ImportDeclarationType) :*: S1 ('MetaSel ('Just "eiImportedAs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe ModuleName)))))

data ExternsFixity #

A fixity declaration in an externs file

Constructors

ExternsFixity |

Fields

- efAssociativity :: Associativity

  The associativity of the operator

- efPrecedence :: Precedence

  The precedence level of the operator

- efOperator :: OpName 'ValueOpName

  The operator symbol

- efAlias :: Qualified (Either Ident (ProperName 'ConstructorName))

  The value the operator is an alias for

#### Instances

Instances details

NFData ExternsFixity # |
Instance details Defined in Language.PureScript.Externs Methods rnf :: ExternsFixity -> () #
Generic ExternsFixity # |

Instance details

Defined in Language.PureScript.Externs

Associated Types

type Rep ExternsFixity |

Instance details

Defined in Language.PureScript.Externs

type Rep ExternsFixity = D1 ('MetaData "ExternsFixity" "Language.PureScript.Externs" "purescript-0.15.15-8K0LbmS63k4ILju2RsIrDp" 'False) (C1 ('MetaCons "ExternsFixity" 'PrefixI 'True) ((S1 ('MetaSel ('Just "efAssociativity") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Associativity) :*: S1 ('MetaSel ('Just "efPrecedence") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Precedence)) :*: (S1 ('MetaSel ('Just "efOperator") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (OpName 'ValueOpName)) :*: S1 ('MetaSel ('Just "efAlias") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Qualified (Either Ident (ProperName 'ConstructorName)))))))

Methods

from :: ExternsFixity -> Rep ExternsFixity x #

to :: Rep ExternsFixity x -> ExternsFixity #

Show ExternsFixity # |
Instance details Defined in Language.PureScript.Externs Methods showsPrec :: Int -> ExternsFixity -> ShowS # show :: ExternsFixity -> String # showList :: [ExternsFixity] -> ShowS #
Serialise ExternsFixity # |
Instance details Defined in Language.PureScript.Externs Methods encode :: ExternsFixity -> Encoding # decode :: Decoder s ExternsFixity # encodeList :: [ExternsFixity] -> Encoding # decodeList :: Decoder s [ExternsFixity] #
type Rep ExternsFixity # |

Instance details

Defined in Language.PureScript.Externs

type Rep ExternsFixity = D1 ('MetaData "ExternsFixity" "Language.PureScript.Externs" "purescript-0.15.15-8K0LbmS63k4ILju2RsIrDp" 'False) (C1 ('MetaCons "ExternsFixity" 'PrefixI 'True) ((S1 ('MetaSel ('Just "efAssociativity") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Associativity) :*: S1 ('MetaSel ('Just "efPrecedence") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Precedence)) :*: (S1 ('MetaSel ('Just "efOperator") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (OpName 'ValueOpName)) :*: S1 ('MetaSel ('Just "efAlias") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Qualified (Either Ident (ProperName 'ConstructorName)))))))

data ExternsTypeFixity #

A type fixity declaration in an externs file

Constructors

ExternsTypeFixity |

Fields

- efTypeAssociativity :: Associativity

  The associativity of the operator

- efTypePrecedence :: Precedence

  The precedence level of the operator

- efTypeOperator :: OpName 'TypeOpName

  The operator symbol

- efTypeAlias :: Qualified (ProperName 'TypeName)

  The value the operator is an alias for

#### Instances

Instances details

NFData ExternsTypeFixity # |
Instance details Defined in Language.PureScript.Externs Methods rnf :: ExternsTypeFixity -> () #
Generic ExternsTypeFixity # |

Instance details

Defined in Language.PureScript.Externs

Associated Types

type Rep ExternsTypeFixity |

Instance details

Defined in Language.PureScript.Externs

type Rep ExternsTypeFixity = D1 ('MetaData "ExternsTypeFixity" "Language.PureScript.Externs" "purescript-0.15.15-8K0LbmS63k4ILju2RsIrDp" 'False) (C1 ('MetaCons "ExternsTypeFixity" 'PrefixI 'True) ((S1 ('MetaSel ('Just "efTypeAssociativity") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Associativity) :*: S1 ('MetaSel ('Just "efTypePrecedence") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Precedence)) :*: (S1 ('MetaSel ('Just "efTypeOperator") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (OpName 'TypeOpName)) :*: S1 ('MetaSel ('Just "efTypeAlias") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Qualified (ProperName 'TypeName))))))

Methods

from :: ExternsTypeFixity -> Rep ExternsTypeFixity x #

to :: Rep ExternsTypeFixity x -> ExternsTypeFixity #

Show ExternsTypeFixity # |
Instance details Defined in Language.PureScript.Externs Methods showsPrec :: Int -> ExternsTypeFixity -> ShowS # show :: ExternsTypeFixity -> String # showList :: [ExternsTypeFixity] -> ShowS #
Serialise ExternsTypeFixity # |
Instance details Defined in Language.PureScript.Externs Methods encode :: ExternsTypeFixity -> Encoding # decode :: Decoder s ExternsTypeFixity # encodeList :: [ExternsTypeFixity] -> Encoding # decodeList :: Decoder s [ExternsTypeFixity] #
type Rep ExternsTypeFixity # |

Instance details

Defined in Language.PureScript.Externs

type Rep ExternsTypeFixity = D1 ('MetaData "ExternsTypeFixity" "Language.PureScript.Externs" "purescript-0.15.15-8K0LbmS63k4ILju2RsIrDp" 'False) (C1 ('MetaCons "ExternsTypeFixity" 'PrefixI 'True) ((S1 ('MetaSel ('Just "efTypeAssociativity") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Associativity) :*: S1 ('MetaSel ('Just "efTypePrecedence") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Precedence)) :*: (S1 ('MetaSel ('Just "efTypeOperator") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (OpName 'TypeOpName)) :*: S1 ('MetaSel ('Just "efTypeAlias") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Qualified (ProperName 'TypeName))))))

data ExternsDeclaration #

A type or value declaration appearing in an externs file

Constructors

EDType | A type declaration

Fields

- edTypeName :: ProperName 'TypeName
- edTypeKind :: SourceType
- edTypeDeclarationKind :: TypeKind

EDTypeSynonym | A type synonym

Fields

- edTypeSynonymName :: ProperName 'TypeName
- edTypeSynonymArguments :: [(Text, Maybe SourceType)]
- edTypeSynonymType :: SourceType

EDDataConstructor | A data constructor

Fields

- edDataCtorName :: ProperName 'ConstructorName
- edDataCtorOrigin :: DataDeclType
- edDataCtorTypeCtor :: ProperName 'TypeName
- edDataCtorType :: SourceType
- edDataCtorFields :: [Ident]

EDValue | A value declaration

Fields

- edValueName :: Ident
- edValueType :: SourceType

EDClass | A type class declaration

Fields

- edClassName :: ProperName 'ClassName
- edClassTypeArguments :: [(Text, Maybe SourceType)]
- edClassMembers :: [(Ident, SourceType)]
- edClassConstraints :: [SourceConstraint]
- edFunctionalDependencies :: [FunctionalDependency]
- edIsEmpty :: Bool

EDInstance | An instance declaration

Fields

- edInstanceClassName :: Qualified (ProperName 'ClassName)
- edInstanceName :: Ident
- edInstanceForAll :: [(Text, SourceType)]
- edInstanceKinds :: [SourceType]
- edInstanceTypes :: [SourceType]
- edInstanceConstraints :: Maybe [SourceConstraint]
- edInstanceChain :: Maybe ChainId
- edInstanceChainIndex :: Integer
- edInstanceNameSource :: NameSource
- edInstanceSourceSpan :: SourceSpan

#### Instances

Instances details

NFData ExternsDeclaration # |
Instance details Defined in Language.PureScript.Externs Methods rnf :: ExternsDeclaration -> () #
Generic ExternsDeclaration # |

Instance details

Defined in Language.PureScript.Externs

Associated Types

type Rep ExternsDeclaration |

Instance details

Defined in Language.PureScript.Externs

type Rep ExternsDeclaration = D1 ('MetaData "ExternsDeclaration" "Language.PureScript.Externs" "purescript-0.15.15-8K0LbmS63k4ILju2RsIrDp" 'False) ((C1 ('MetaCons "EDType" 'PrefixI 'True) (S1 ('MetaSel ('Just "edTypeName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ProperName 'TypeName)) :*: (S1 ('MetaSel ('Just "edTypeKind") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SourceType) :*: S1 ('MetaSel ('Just "edTypeDeclarationKind") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 TypeKind))) :+: (C1 ('MetaCons "EDTypeSynonym" 'PrefixI 'True) (S1 ('MetaSel ('Just "edTypeSynonymName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ProperName 'TypeName)) :*: (S1 ('MetaSel ('Just "edTypeSynonymArguments") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(Text, Maybe SourceType)]) :*: S1 ('MetaSel ('Just "edTypeSynonymType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SourceType))) :+: C1 ('MetaCons "EDDataConstructor" 'PrefixI 'True) ((S1 ('MetaSel ('Just "edDataCtorName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ProperName 'ConstructorName)) :*: S1 ('MetaSel ('Just "edDataCtorOrigin") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 DataDeclType)) :*: (S1 ('MetaSel ('Just "edDataCtorTypeCtor") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ProperName 'TypeName)) :*: (S1 ('MetaSel ('Just "edDataCtorType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SourceType) :*: S1 ('MetaSel ('Just "edDataCtorFields") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Ident])))))) :+: (C1 ('MetaCons "EDValue" 'PrefixI 'True) (S1 ('MetaSel ('Just "edValueName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Ident) :*: S1 ('MetaSel ('Just "edValueType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SourceType)) :+: (C1 ('MetaCons "EDClass" 'PrefixI 'True) ((S1 ('MetaSel ('Just "edClassName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ProperName 'ClassName)) :*: (S1 ('MetaSel ('Just "edClassTypeArguments") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(Text, Maybe SourceType)]) :*: S1 ('MetaSel ('Just "edClassMembers") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(Ident, SourceType)]))) :*: (S1 ('MetaSel ('Just "edClassConstraints") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [SourceConstraint]) :*: (S1 ('MetaSel ('Just "edFunctionalDependencies") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [FunctionalDependency]) :*: S1 ('MetaSel ('Just "edIsEmpty") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)))) :+: C1 ('MetaCons "EDInstance" 'PrefixI 'True) (((S1 ('MetaSel ('Just "edInstanceClassName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Qualified (ProperName 'ClassName))) :*: S1 ('MetaSel ('Just "edInstanceName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Ident)) :*: (S1 ('MetaSel ('Just "edInstanceForAll") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(Text, SourceType)]) :*: (S1 ('MetaSel ('Just "edInstanceKinds") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [SourceType]) :*: S1 ('MetaSel ('Just "edInstanceTypes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [SourceType])))) :*: ((S1 ('MetaSel ('Just "edInstanceConstraints") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe [SourceConstraint])) :*: S1 ('MetaSel ('Just "edInstanceChain") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe ChainId))) :*: (S1 ('MetaSel ('Just "edInstanceChainIndex") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Integer) :*: (S1 ('MetaSel ('Just "edInstanceNameSource") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 NameSource) :*: S1 ('MetaSel ('Just "edInstanceSourceSpan") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SourceSpan))))))))

Methods

from :: ExternsDeclaration -> Rep ExternsDeclaration x #

to :: Rep ExternsDeclaration x -> ExternsDeclaration #

Show ExternsDeclaration # |
Instance details Defined in Language.PureScript.Externs Methods showsPrec :: Int -> ExternsDeclaration -> ShowS # show :: ExternsDeclaration -> String # showList :: [ExternsDeclaration] -> ShowS #
Serialise ExternsDeclaration # |
Instance details Defined in Language.PureScript.Externs Methods encode :: ExternsDeclaration -> Encoding # decode :: Decoder s ExternsDeclaration # encodeList :: [ExternsDeclaration] -> Encoding # decodeList :: Decoder s [ExternsDeclaration] #
type Rep ExternsDeclaration # |

Instance details

Defined in Language.PureScript.Externs

type Rep ExternsDeclaration = D1 ('MetaData "ExternsDeclaration" "Language.PureScript.Externs" "purescript-0.15.15-8K0LbmS63k4ILju2RsIrDp" 'False) ((C1 ('MetaCons "EDType" 'PrefixI 'True) (S1 ('MetaSel ('Just "edTypeName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ProperName 'TypeName)) :*: (S1 ('MetaSel ('Just "edTypeKind") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SourceType) :*: S1 ('MetaSel ('Just "edTypeDeclarationKind") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 TypeKind))) :+: (C1 ('MetaCons "EDTypeSynonym" 'PrefixI 'True) (S1 ('MetaSel ('Just "edTypeSynonymName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ProperName 'TypeName)) :*: (S1 ('MetaSel ('Just "edTypeSynonymArguments") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(Text, Maybe SourceType)]) :*: S1 ('MetaSel ('Just "edTypeSynonymType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SourceType))) :+: C1 ('MetaCons "EDDataConstructor" 'PrefixI 'True) ((S1 ('MetaSel ('Just "edDataCtorName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ProperName 'ConstructorName)) :*: S1 ('MetaSel ('Just "edDataCtorOrigin") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 DataDeclType)) :*: (S1 ('MetaSel ('Just "edDataCtorTypeCtor") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ProperName 'TypeName)) :*: (S1 ('MetaSel ('Just "edDataCtorType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SourceType) :*: S1 ('MetaSel ('Just "edDataCtorFields") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Ident])))))) :+: (C1 ('MetaCons "EDValue" 'PrefixI 'True) (S1 ('MetaSel ('Just "edValueName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Ident) :*: S1 ('MetaSel ('Just "edValueType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SourceType)) :+: (C1 ('MetaCons "EDClass" 'PrefixI 'True) ((S1 ('MetaSel ('Just "edClassName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (ProperName 'ClassName)) :*: (S1 ('MetaSel ('Just "edClassTypeArguments") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(Text, Maybe SourceType)]) :*: S1 ('MetaSel ('Just "edClassMembers") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(Ident, SourceType)]))) :*: (S1 ('MetaSel ('Just "edClassConstraints") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [SourceConstraint]) :*: (S1 ('MetaSel ('Just "edFunctionalDependencies") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [FunctionalDependency]) :*: S1 ('MetaSel ('Just "edIsEmpty") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)))) :+: C1 ('MetaCons "EDInstance" 'PrefixI 'True) (((S1 ('MetaSel ('Just "edInstanceClassName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Qualified (ProperName 'ClassName))) :*: S1 ('MetaSel ('Just "edInstanceName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Ident)) :*: (S1 ('MetaSel ('Just "edInstanceForAll") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(Text, SourceType)]) :*: (S1 ('MetaSel ('Just "edInstanceKinds") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [SourceType]) :*: S1 ('MetaSel ('Just "edInstanceTypes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [SourceType])))) :*: ((S1 ('MetaSel ('Just "edInstanceConstraints") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe [SourceConstraint])) :*: S1 ('MetaSel ('Just "edInstanceChain") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe ChainId))) :*: (S1 ('MetaSel ('Just "edInstanceChainIndex") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Integer) :*: (S1 ('MetaSel ('Just "edInstanceNameSource") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 NameSource) :*: S1 ('MetaSel ('Just "edInstanceSourceSpan") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SourceSpan))))))))

externsIsCurrentVersion :: ExternsFile -> Bool #

Check whether the version in an externs file matches the currently running version.

moduleToExternsFile :: Module -> Environment -> Map Ident Ident -> ExternsFile #

Generate an externs file for all declarations in a module.

The `Map Ident Ident` argument should contain any top-level `GenIdent`s that were rewritten to `Ident`s when the module was compiled; this rewrite only happens in the CoreFn, not the original module AST, so it needs to be applied to the exported names here also. (The appropriate map is returned by `renameInModule`.)

applyExternsFileToEnvironment :: ExternsFile -> Environment -> Environment #

Convert an externs file back into a module

externsFileName :: FilePath #