Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data Package a = Package {}
- data NotYetKnown = NotYetKnown
- type UploadedPackage = Package NotYetKnown
- type VerifiedPackage = Package GithubUser
- type ManifestError = BowerError
- verifyPackage :: GithubUser -> UploadedPackage -> VerifiedPackage
- packageName :: Package a -> PackageName
- jsonTimeFormat :: String
- formatTime :: UTCTime -> String
- parseTime :: String -> Maybe UTCTime
- data Module = Module {
- modName :: ModuleName
- modComments :: Maybe Text
- modDeclarations :: [Declaration]
- modReExports :: [(InPackage ModuleName, [Declaration])]
- data Declaration = Declaration {}
- data DeclarationInfo
- = ValueDeclaration Type
- | DataDeclaration DataDeclType [(Text, Maybe Kind)]
- | ExternDataDeclaration Kind
- | TypeSynonymDeclaration [(Text, Maybe Kind)] Type
- | TypeClassDeclaration [(Text, Maybe Kind)] [Constraint] [([Text], [Text])]
- | AliasDeclaration Fixity FixityAlias
- | ExternKindDeclaration
- convertFundepsToStrings :: [(Text, Maybe Kind)] -> [FunctionalDependency] -> [([Text], [Text])]
- declInfoToString :: DeclarationInfo -> Text
- declInfoNamespace :: DeclarationInfo -> Namespace
- isTypeClass :: Declaration -> Bool
- isValue :: Declaration -> Bool
- isType :: Declaration -> Bool
- isValueAlias :: Declaration -> Bool
- isTypeAlias :: Declaration -> Bool
- isKind :: Declaration -> Bool
- filterChildren :: (ChildDeclaration -> Bool) -> Declaration -> Declaration
- data ChildDeclaration = ChildDeclaration {}
- data ChildDeclarationInfo
- childDeclInfoToString :: ChildDeclarationInfo -> Text
- childDeclInfoNamespace :: ChildDeclarationInfo -> Namespace
- isTypeClassMember :: ChildDeclaration -> Bool
- isDataConstructor :: ChildDeclaration -> Bool
- newtype GithubUser = GithubUser {}
- newtype GithubRepo = GithubRepo {}
- data PackageError
- data InPackage a
- = Local a
- | FromDep PackageName a
- takeLocal :: InPackage a -> Maybe a
- takeLocals :: [InPackage a] -> [a]
- ignorePackage :: InPackage a -> a
- data LinksContext = LinksContext {}
- data DocLink = DocLink {}
- data LinkLocation
- getLink :: LinksContext -> ModuleName -> Namespace -> Text -> ContainingModule -> Maybe DocLink
- getLinksContext :: Package a -> LinksContext
- parseUploadedPackage :: Version -> LByteString -> Either (ParseError PackageError) UploadedPackage
- parseVerifiedPackage :: Version -> LByteString -> Either (ParseError PackageError) VerifiedPackage
- asPackage :: Version -> (forall e. Parse e a) -> Parse PackageError (Package a)
- parseTimeEither :: String -> Either PackageError UTCTime
- asUploadedPackage :: Version -> Parse PackageError UploadedPackage
- asNotYetKnown :: Parse e NotYetKnown
- asVerifiedPackage :: Version -> Parse PackageError VerifiedPackage
- displayPackageError :: PackageError -> Text
- asGithubUser :: Parse e GithubUser
- asVersion :: Parse PackageError Version
- parseVersion' :: String -> Maybe Version
- asModule :: Parse PackageError Module
- asDeclaration :: Parse PackageError Declaration
- asReExport :: Parse PackageError (InPackage ModuleName, [Declaration])
- pOr :: Parse e a -> Parse e a -> Parse e a
- asInPackage :: Parse ManifestError a -> Parse ManifestError (InPackage a)
- asFixity :: Parse PackageError Fixity
- asFixityAlias :: Parse PackageError FixityAlias
- parseAssociativity :: String -> Maybe Associativity
- asAssociativity :: Parse PackageError Associativity
- asDeclarationInfo :: Parse PackageError DeclarationInfo
- asTypeArguments :: Parse PackageError [(Text, Maybe Kind)]
- asKind :: Parse PackageError Kind
- asType :: Parse e Type
- asFunDeps :: Parse PackageError [([Text], [Text])]
- asDataDeclType :: Parse PackageError DataDeclType
- asChildDeclaration :: Parse PackageError ChildDeclaration
- asChildDeclarationInfo :: Parse PackageError ChildDeclarationInfo
- asSourcePos :: Parse e SourcePos
- asConstraint :: Parse PackageError Constraint
- asQualifiedProperName :: Parse e (Qualified (ProperName a))
- asQualifiedIdent :: Parse e (Qualified Ident)
- asModuleMap :: Parse PackageError (Map ModuleName PackageName)
- bookmarksAsModuleMap :: Parse ManifestError (Map ModuleName PackageName)
- asResolvedDependencies :: Parse PackageError [(PackageName, Version)]
- parsePackageName' :: Text -> Either PackageError PackageName
- mapLeft :: (a -> a') -> Either a b -> Either a' b
- asGithub :: Parse e (GithubUser, GithubRepo)
- asSourceSpan :: Parse e SourceSpan
- assocListToJSON :: (a -> Text) -> (b -> Text) -> [(a, b)] -> Value
Documentation
Package | |
|
data NotYetKnown Source #
type UploadedPackage = Package NotYetKnown Source #
type VerifiedPackage = Package GithubUser Source #
type ManifestError = BowerError Source #
packageName :: Package a -> PackageName Source #
jsonTimeFormat :: String Source #
The time format used for serializing package tag times in the JSON format. This is the ISO 8601 date format which includes a time and a timezone.
formatTime :: UTCTime -> String Source #
Convenience function for formatting a time in the format expected by this module.
parseTime :: String -> Maybe UTCTime Source #
Convenience function for parsing a time in the format expected by this module.
Module | |
|
data DeclarationInfo Source #
A value of this type contains information that is specific to a particular
kind of declaration (as opposed to information which exists in all kinds of
declarations, which goes into the Declaration
type directly).
Many of the constructors are very similar to their equivalents in the real
PureScript AST, except that they have their name elided, since this is
already available via the rdTitle field of Declaration
.
ValueDeclaration Type | A value declaration, with its type. |
DataDeclaration DataDeclType [(Text, Maybe Kind)] | A data/newtype declaration, with the kind of declaration (data or newtype) and its type arguments. Constructors are represented as child declarations. |
ExternDataDeclaration Kind | A data type foreign import, with its kind. |
TypeSynonymDeclaration [(Text, Maybe Kind)] Type | A type synonym, with its type arguments and its type. |
TypeClassDeclaration [(Text, Maybe Kind)] [Constraint] [([Text], [Text])] | A type class, with its type arguments, its superclasses and functional dependencies. Instances and members are represented as child declarations. |
AliasDeclaration Fixity FixityAlias | An operator alias declaration, with the member the alias is for and the operator's fixity. |
ExternKindDeclaration | A kind declaration |
convertFundepsToStrings :: [(Text, Maybe Kind)] -> [FunctionalDependency] -> [([Text], [Text])] Source #
isTypeClass :: Declaration -> Bool Source #
isValue :: Declaration -> Bool Source #
isType :: Declaration -> Bool Source #
isValueAlias :: Declaration -> Bool Source #
isTypeAlias :: Declaration -> Bool Source #
isKind :: Declaration -> Bool Source #
filterChildren :: (ChildDeclaration -> Bool) -> Declaration -> Declaration Source #
Discard any children which do not satisfy the given predicate.
data ChildDeclarationInfo Source #
ChildInstance [Constraint] Type | A type instance declaration, with its dependencies and its type. |
ChildDataConstructor [Type] | A data constructor, with its type arguments. |
ChildTypeClassMember Type | A type class member, with its type. Note that the type does not include
the type class constraint; this may be added manually if desired. For
example, |
newtype GithubUser Source #
newtype GithubRepo Source #
data PackageError Source #
CompilerTooOld Version Version | Minimum allowable version for generating data with the current parser, and actual version used. |
ErrorInPackageMeta ManifestError | |
InvalidVersion | |
InvalidDeclarationType Text | |
InvalidChildDeclarationType Text | |
InvalidFixity | |
InvalidKind Text | |
InvalidDataDeclType Text | |
InvalidTime |
Local a | |
FromDep PackageName a |
takeLocals :: [InPackage a] -> [a] Source #
ignorePackage :: InPackage a -> a Source #
data LinkLocation Source #
SameModule | A link to a declaration in the same module. |
LocalModule ModuleName ModuleName | A link to a declaration in a different module, but still in the current package; we need to store the current module and the other declaration's module. |
DepsModule ModuleName PackageName Version ModuleName | A link to a declaration in a different package. We store: current module name, name of the other package, version of the other package, and name of the module in the other package that the declaration is in. |
BuiltinModule ModuleName | A link to a declaration that is built in to the compiler, e.g. the Prim module. In this case we only need to store the module that the builtin comes from. Note that all builtin modules begin with Prim, and that the compiler rejects attempts to define modules whose names start with Prim. |
getLink :: LinksContext -> ModuleName -> Namespace -> Text -> ContainingModule -> Maybe DocLink Source #
Given a links context, the current module name, the namespace of a thing to link to, its title, and its containing module, attempt to create a DocLink.
getLinksContext :: Package a -> LinksContext Source #
parseUploadedPackage :: Version -> LByteString -> Either (ParseError PackageError) UploadedPackage Source #
parseVerifiedPackage :: Version -> LByteString -> Either (ParseError PackageError) VerifiedPackage Source #
asNotYetKnown :: Parse e NotYetKnown Source #
asGithubUser :: Parse e GithubUser Source #
asInPackage :: Parse ManifestError a -> Parse ManifestError (InPackage a) Source #
asTypeArguments :: Parse PackageError [(Text, Maybe Kind)] Source #
asSourcePos :: Parse e SourcePos Source #
asQualifiedProperName :: Parse e (Qualified (ProperName a)) Source #
asGithub :: Parse e (GithubUser, GithubRepo) Source #
asSourceSpan :: Parse e SourceSpan Source #
assocListToJSON :: (a -> Text) -> (b -> Text) -> [(a, b)] -> Value Source #
Given a function for turning association list keys into JSON object keys, and a function for turning association list values to JSON string values, turns an association list into a JSON object.
For example:
assocListToJSON T.pack T.pack [("a", "b")]
will give {"a": "b"}
.