purescript-0.11.2: PureScript Programming Language Compiler

Safe HaskellNone




data Package a Source #





Eq a => Eq (Package a) Source # 


(==) :: Package a -> Package a -> Bool #

(/=) :: Package a -> Package a -> Bool #

Ord a => Ord (Package a) Source # 


compare :: Package a -> Package a -> Ordering #

(<) :: Package a -> Package a -> Bool #

(<=) :: Package a -> Package a -> Bool #

(>) :: Package a -> Package a -> Bool #

(>=) :: Package a -> Package a -> Bool #

max :: Package a -> Package a -> Package a #

min :: Package a -> Package a -> Package a #

Show a => Show (Package a) Source # 


showsPrec :: Int -> Package a -> ShowS #

show :: Package a -> String #

showList :: [Package a] -> ShowS #

ToJSON a => ToJSON (Package a) Source # 
FromJSON a => FromJSON (Package a) 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.

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.


A kind declaration

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

data InPackage a Source #


Local a 
FromDep PackageName a 


data LinkLocation Source #



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 (at the time of writing, this will only ever be 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.

asPackage :: Version -> (forall e. Parse e a) -> Parse PackageError (Package a) Source #

pOr :: Parse e a -> Parse e a -> Parse e a Source #

mapLeft :: (a -> a') -> Either a b -> Either a' b 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"}.