purescript-0.11.6: PureScript Programming Language Compiler

Safe HaskellNone
LanguageHaskell2010

Language.PureScript.Docs.Types

Synopsis

Documentation

data Package a #

Constructors

Package 

Fields

Instances

Eq a => Eq (Package a) # 

Methods

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

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

Ord a => Ord (Package a) # 

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) # 

Methods

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

show :: Package a -> String #

showList :: [Package a] -> ShowS #

Generic (Package a) # 

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) # 
FromJSON a => FromJSON (Package a) # 
NFData a => NFData (Package a) # 

Methods

rnf :: Package a -> () #

type Rep (Package a) # 

jsonTimeFormat :: String #

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 #

Convenience function for formatting a time in the format expected by this module.

parseTime :: String -> Maybe UTCTime #

Convenience function for parsing a time in the format expected by this module.

data Module #

Instances

Eq Module # 

Methods

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

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

Ord Module # 
Show Module # 
Generic Module # 

Associated Types

type Rep Module :: * -> * #

Methods

from :: Module -> Rep Module x #

to :: Rep Module x -> Module #

ToJSON Module # 
NFData Module # 

Methods

rnf :: Module -> () #

type Rep Module # 

data Declaration #

Instances

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

Associated Types

type Rep Declaration :: * -> * #

ToJSON Declaration # 
NFData Declaration # 

Methods

rnf :: Declaration -> () #

type Rep Declaration # 

data DeclarationInfo #

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 # 
Ord DeclarationInfo # 
Show DeclarationInfo # 
Generic DeclarationInfo # 
ToJSON DeclarationInfo # 
NFData DeclarationInfo # 

Methods

rnf :: DeclarationInfo -> () #

type Rep DeclarationInfo # 
type Rep DeclarationInfo = D1 (MetaData "DeclarationInfo" "Language.PureScript.Docs.Types" "purescript-0.11.6-FH7waWkD6GQKRwiG3siRFE" 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 #

Discard any children which do not satisfy the given predicate.

data ChildDeclaration #

Instances

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

Methods

rnf :: ChildDeclaration -> () #

type Rep ChildDeclaration # 
type Rep ChildDeclaration = D1 (MetaData "ChildDeclaration" "Language.PureScript.Docs.Types" "purescript-0.11.6-FH7waWkD6GQKRwiG3siRFE" 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 #

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 # 
Ord ChildDeclarationInfo # 
Show ChildDeclarationInfo # 
Generic ChildDeclarationInfo # 
ToJSON ChildDeclarationInfo # 
NFData ChildDeclarationInfo # 

Methods

rnf :: ChildDeclarationInfo -> () #

type Rep ChildDeclarationInfo # 

data PackageError #

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 # 
Ord PackageError # 
Show PackageError # 
Generic PackageError # 

Associated Types

type Rep PackageError :: * -> * #

NFData PackageError # 

Methods

rnf :: PackageError -> () #

type Rep PackageError # 

data InPackage a #

Constructors

Local a 
FromDep PackageName a 

Instances

Functor InPackage # 

Methods

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

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

Eq a => Eq (InPackage a) # 

Methods

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

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

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

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) # 
NFData a => NFData (InPackage a) # 

Methods

rnf :: InPackage a -> () #

type Rep (InPackage a) # 

takeLocals :: [InPackage a] -> [a] #

data LinksContext #

Instances

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

Associated Types

type Rep LinksContext :: * -> * #

NFData LinksContext # 

Methods

rnf :: LinksContext -> () #

type Rep LinksContext # 

data DocLink #

data LinkLocation #

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

Instances

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

Associated Types

type Rep LinkLocation :: * -> * #

NFData LinkLocation # 

Methods

rnf :: LinkLocation -> () #

type Rep LinkLocation # 

getLink :: LinksContext -> ModuleName -> Namespace -> Text -> ContainingModule -> Maybe DocLink #

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) #

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

mapLeft :: (a -> a') -> Either a b -> Either a' b #

assocListToJSON :: (a -> Text) -> (b -> Text) -> [(a, b)] -> Value #

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