purescript-0.12.0: PureScript Programming Language Compiler

Safe HaskellNone
LanguageHaskell2010

Language.PureScript.Docs.Types

Synopsis

Documentation

data Package a Source #

Constructors

Package 

Fields

Instances

Eq a => Eq (Package a) Source # 

Methods

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

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

Ord a => Ord (Package a) Source # 

Methods

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 # 

Methods

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

show :: Package a -> String #

showList :: [Package a] -> ShowS #

Generic (Package a) Source # 

Associated Types

type Rep (Package a) :: * -> * #

Methods

from :: Package a -> Rep (Package a) x #

to :: Rep (Package a) x -> Package a #

ToJSON a => ToJSON (Package a) Source # 
FromJSON a => FromJSON (Package a) Source # 
NFData a => NFData (Package a) Source # 

Methods

rnf :: Package a -> () #

type Rep (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 Module Source #

Instances

Eq Module Source # 

Methods

(==) :: Module -> Module -> Bool #

(/=) :: Module -> Module -> Bool #

Ord Module Source # 
Show Module Source # 
Generic Module Source # 

Associated Types

type Rep Module :: * -> * #

Methods

from :: Module -> Rep Module x #

to :: Rep Module x -> Module #

ToJSON Module Source # 
NFData Module Source # 

Methods

rnf :: Module -> () #

type Rep Module Source # 

data Declaration Source #

Instances

Eq Declaration Source # 
Ord Declaration Source # 
Show Declaration Source # 
Generic Declaration Source # 

Associated Types

type Rep Declaration :: * -> * #

ToJSON Declaration Source # 
NFData Declaration Source # 

Methods

rnf :: Declaration -> () #

type Rep Declaration Source # 

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.

Constructors

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

Instances

Eq DeclarationInfo Source # 
Ord DeclarationInfo Source # 
Show DeclarationInfo Source # 
Generic DeclarationInfo Source # 
ToJSON DeclarationInfo Source # 
NFData DeclarationInfo Source # 

Methods

rnf :: DeclarationInfo -> () #

type Rep DeclarationInfo Source # 
type Rep DeclarationInfo = D1 * (MetaData "DeclarationInfo" "Language.PureScript.Docs.Types" "purescript-0.12.0-GnFPE64AyqYHZk4VD04uBy" False) ((:+:) * ((:+:) * (C1 * (MetaCons "ValueDeclaration" PrefixI False) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * Type))) ((:+:) * (C1 * (MetaCons "DataDeclaration" PrefixI False) ((:*:) * (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * DataDeclType)) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * [(Text, Maybe Kind)])))) (C1 * (MetaCons "ExternDataDeclaration" PrefixI False) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * Kind))))) ((:+:) * ((:+:) * (C1 * (MetaCons "TypeSynonymDeclaration" PrefixI False) ((:*:) * (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * [(Text, Maybe Kind)])) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * Type)))) (C1 * (MetaCons "TypeClassDeclaration" PrefixI False) ((:*:) * (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * [(Text, Maybe Kind)])) ((:*:) * (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * [Constraint])) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * [([Text], [Text])])))))) ((:+:) * (C1 * (MetaCons "AliasDeclaration" PrefixI False) ((:*:) * (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * Fixity)) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * FixityAlias)))) (C1 * (MetaCons "ExternKindDeclaration" PrefixI False) (U1 *)))))

filterChildren :: (ChildDeclaration -> Bool) -> Declaration -> Declaration Source #

Discard any children which do not satisfy the given predicate.

data ChildDeclaration Source #

Instances

Eq ChildDeclaration Source # 
Ord ChildDeclaration Source # 
Show ChildDeclaration Source # 
Generic ChildDeclaration Source # 
ToJSON ChildDeclaration Source # 
NFData ChildDeclaration Source # 

Methods

rnf :: ChildDeclaration -> () #

type Rep ChildDeclaration Source # 
type Rep ChildDeclaration = D1 * (MetaData "ChildDeclaration" "Language.PureScript.Docs.Types" "purescript-0.12.0-GnFPE64AyqYHZk4VD04uBy" False) (C1 * (MetaCons "ChildDeclaration" PrefixI True) ((:*:) * ((:*:) * (S1 * (MetaSel (Just Symbol "cdeclTitle") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * Text)) (S1 * (MetaSel (Just Symbol "cdeclComments") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * (Maybe Text)))) ((:*:) * (S1 * (MetaSel (Just Symbol "cdeclSourceSpan") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * (Maybe SourceSpan))) (S1 * (MetaSel (Just Symbol "cdeclInfo") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * ChildDeclarationInfo)))))

data ChildDeclarationInfo Source #

Constructors

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`.

Instances

Eq ChildDeclarationInfo Source # 
Ord ChildDeclarationInfo Source # 
Show ChildDeclarationInfo Source # 
Generic ChildDeclarationInfo Source # 
ToJSON ChildDeclarationInfo Source # 
NFData ChildDeclarationInfo Source # 

Methods

rnf :: ChildDeclarationInfo -> () #

type Rep ChildDeclarationInfo Source # 

newtype GithubUser Source #

Constructors

GithubUser 

Fields

data PackageError Source #

Constructors

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 

Instances

Eq PackageError Source # 
Ord PackageError Source # 
Show PackageError Source # 
Generic PackageError Source # 

Associated Types

type Rep PackageError :: * -> * #

NFData PackageError Source # 

Methods

rnf :: PackageError -> () #

type Rep PackageError Source # 

data InPackage a Source #

Constructors

Local a 
FromDep PackageName a 

Instances

Functor InPackage Source # 

Methods

fmap :: (a -> b) -> InPackage a -> InPackage b #

(<$) :: a -> InPackage b -> InPackage a #

Eq a => Eq (InPackage a) Source # 

Methods

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

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

Ord a => Ord (InPackage a) Source # 
Show a => Show (InPackage a) Source # 
Generic (InPackage a) Source # 

Associated Types

type Rep (InPackage a) :: * -> * #

Methods

from :: InPackage a -> Rep (InPackage a) x #

to :: Rep (InPackage a) x -> InPackage a #

ToJSON a => ToJSON (InPackage a) Source # 
NFData a => NFData (InPackage a) Source # 

Methods

rnf :: InPackage a -> () #

type Rep (InPackage a) Source # 

data LinksContext Source #

Instances

Eq LinksContext Source # 
Ord LinksContext Source # 
Show LinksContext Source # 
Generic LinksContext Source # 

Associated Types

type Rep LinksContext :: * -> * #

NFData LinksContext Source # 

Methods

rnf :: LinksContext -> () #

type Rep LinksContext Source # 

data DocLink Source #

data LinkLocation Source #

Constructors

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.

Instances

Eq LinkLocation Source # 
Ord LinkLocation Source # 
Show LinkLocation Source # 
Generic LinkLocation Source # 

Associated Types

type Rep LinkLocation :: * -> * #

NFData LinkLocation Source # 

Methods

rnf :: LinkLocation -> () #

type Rep LinkLocation Source # 

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"}.