Safe Haskell | None |
---|---|
Language | Haskell98 |
- data Package a = Package {
- pkgMeta :: PackageMeta
- pkgVersion :: Version
- pkgVersionTag :: Text
- 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 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])]
- type FixityAlias = Qualified (Either (ProperName TypeName) (Either Ident (ProperName ConstructorName)))
- declInfoToString :: DeclarationInfo -> Text
- 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
- isTypeClassMember :: ChildDeclaration -> Bool
- isDataConstructor :: ChildDeclaration -> Bool
- newtype GithubUser = GithubUser {}
- newtype GithubRepo = GithubRepo {}
- data PackageError
- type Bookmark = InPackage (ModuleName, Text)
- 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 (InPackage ModuleName, [Declaration])
- asInPackage :: Parse BowerError a -> Parse BowerError (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)
- 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 [(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 #
type FixityAlias = Qualified (Either (ProperName TypeName) (Either Ident (ProperName ConstructorName))) 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 BowerError | |
InvalidVersion | |
InvalidDeclarationType Text | |
InvalidChildDeclarationType Text | |
InvalidFixity | |
InvalidKind Text | |
InvalidDataDeclType Text |
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 #
asNotYetKnown :: Parse e NotYetKnown Source #
asGithubUser :: Parse e GithubUser Source #
asInPackage :: Parse BowerError a -> Parse BowerError (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"}
.