Safe Haskell | None |
---|---|
Language | Haskell98 |
- data Package a = Package {
- pkgMeta :: PackageMeta
- pkgVersion :: Version
- pkgVersionTag :: String
- pkgModules :: [Module]
- pkgBookmarks :: [Bookmark]
- pkgResolvedDependencies :: [(PackageName, Version)]
- pkgGithub :: (GithubUser, GithubRepo)
- pkgUploader :: a
- pkgCompilerVersion :: Version
- data NotYetKnown = NotYetKnown
- type UploadedPackage = Package NotYetKnown
- type VerifiedPackage = Package GithubUser
- verifyPackage :: GithubUser -> UploadedPackage -> VerifiedPackage
- packageName :: Package a -> PackageName
- data Module = Module {
- modName :: ModuleName
- modComments :: Maybe String
- modDeclarations :: [Declaration]
- modReExports :: [(ModuleName, [Declaration])]
- data Declaration = Declaration {}
- data DeclarationInfo
- = ValueDeclaration Type
- | DataDeclaration DataDeclType [(String, Maybe Kind)]
- | ExternDataDeclaration Kind
- | TypeSynonymDeclaration [(String, Maybe Kind)] Type
- | TypeClassDeclaration [(String, Maybe Kind)] [Constraint]
- | AliasDeclaration (Either (Qualified Ident) (Qualified (ProperName ConstructorName))) Fixity
- declInfoToString :: DeclarationInfo -> String
- isTypeClass :: Declaration -> Bool
- isValue :: Declaration -> Bool
- isType :: Declaration -> Bool
- isAlias :: Declaration -> Bool
- filterChildren :: (ChildDeclaration -> Bool) -> Declaration -> Declaration
- data ChildDeclaration = ChildDeclaration {}
- data ChildDeclarationInfo
- childDeclInfoToString :: ChildDeclarationInfo -> String
- isTypeClassMember :: ChildDeclaration -> Bool
- isDataConstructor :: ChildDeclaration -> Bool
- newtype GithubUser = GithubUser {}
- newtype GithubRepo = GithubRepo {}
- data PackageError
- type Bookmark = InPackage (ModuleName, String)
- data InPackage a
- = Local a
- | FromDep PackageName a
- takeLocal :: InPackage a -> Maybe a
- takeLocals :: [InPackage a] -> [a]
- ignorePackage :: InPackage a -> a
- parseUploadedPackage :: Version -> ByteString -> Either (ParseError PackageError) UploadedPackage
- parseVerifiedPackage :: Version -> ByteString -> Either (ParseError PackageError) VerifiedPackage
- asPackage :: Version -> (forall e. Parse e a) -> Parse PackageError (Package a)
- 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 (ModuleName, [Declaration])
- asInPackage :: Parse BowerError a -> Parse BowerError (InPackage a)
- asFixity :: Parse PackageError Fixity
- parseAssociativity :: String -> Maybe Associativity
- asAssociativity :: Parse PackageError Associativity
- asDeclarationInfo :: Parse PackageError DeclarationInfo
- asAliasFor :: Parse e (Either (Qualified Ident) (Qualified (ProperName ConstructorName)))
- asTypeArguments :: Parse PackageError [(String, Maybe Kind)]
- asKind :: Parse e Kind
- asType :: Parse e Type
- 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)
- asBookmarks :: Parse BowerError [Bookmark]
- asBookmark :: Parse BowerError Bookmark
- asResolvedDependencies :: Parse PackageError [(PackageName, Version)]
- 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
packageName :: Package a -> PackageName Source
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 [(String, 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 [(String, Maybe Kind)] Type | A type synonym, with its type arguments and its type. |
TypeClassDeclaration [(String, Maybe Kind)] [Constraint] | A type class, with its type arguments and its superclasses. Instances and members are represented as child declarations. |
AliasDeclaration (Either (Qualified Ident) (Qualified (ProperName ConstructorName))) Fixity | An operator alias declaration, with the member the alias is for and the operator's fixity. |
isTypeClass :: Declaration -> Bool Source
isValue :: Declaration -> Bool Source
isType :: Declaration -> Bool Source
isAlias :: 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 BowerError | |
InvalidVersion | |
InvalidDeclarationType String | |
InvalidChildDeclarationType String | |
InvalidFixity | |
InvalidKind String | |
InvalidDataDeclType String |
type Bookmark = InPackage (ModuleName, String) Source
Local a | |
FromDep PackageName a |
takeLocals :: [InPackage a] -> [a] Source
ignorePackage :: InPackage a -> a Source
parseUploadedPackage :: Version -> ByteString -> Either (ParseError PackageError) UploadedPackage Source
parseVerifiedPackage :: Version -> ByteString -> Either (ParseError PackageError) VerifiedPackage Source
parseVersion' :: String -> Maybe Version Source
asInPackage :: Parse BowerError a -> Parse BowerError (InPackage a) Source
asAliasFor :: Parse e (Either (Qualified Ident) (Qualified (ProperName ConstructorName))) Source
asTypeArguments :: Parse PackageError [(String, Maybe Kind)] Source
asSourcePos :: Parse e SourcePos Source
asQualifiedProperName :: Parse e (Qualified (ProperName a)) Source
asQualifiedIdent :: Parse e (Qualified Ident) Source
asGithub :: Parse e (GithubUser, GithubRepo) 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"}
.