purescript- PureScript Programming Language Compiler

Safe HaskellNone




data Package a Source




pkgMeta :: PackageMeta
pkgVersion :: Version
pkgVersionTag :: String
pkgModules :: [Module]
pkgBookmarks :: [Bookmark]
pkgResolvedDependencies :: [(PackageName, Version)]
pkgGithub :: (GithubUser, GithubRepo)
pkgUploader :: a
pkgCompilerVersion :: Version

The version of the PureScript compiler which was used to generate this data. We store this in order to reject packages which are too old.


Eq a => Eq (Package a) 
Ord a => Ord (Package a) 
Show a => Show (Package a) 
ToJSON a => ToJSON (Package a) 
FromJSON a => FromJSON (Package a) 

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.

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, pure from Applicative would be `forall a. a -> f a`.

data InPackage a Source


Local a 
FromDep PackageName a 


Functor InPackage 
Eq a => Eq (InPackage a) 
Ord a => Ord (InPackage a) 
Show a => Show (InPackage a) 
ToJSON a => ToJSON (InPackage a) 

asPackage :: Version -> (forall e. Parse e a) -> Parse PackageError (Package a) 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"}.