drasil-system-0.1.1.0: A framework for code and document generation for scientific software - System SubPackage
Safe HaskellNone
LanguageGHC2024

Drasil.System

Synopsis

Documentation

type Purpose = [Sentence] Source #

Project Example purpose.

type Background = [Sentence] Source #

Project Example background information, used in the What section of README.

type Scope = [Sentence] Source #

Project Example scope.

type Motivation = [Sentence] Source #

Project Example motivation.

data ProjectName Source #

General software projects generally have at least 3 names: a human-readable title, a human-preferred abbreviation, and a preferred repository name (slug). For example, "Drasil: A Software Generation Framework", Drasil, and "drasil".

Instances

Instances details
HasChunkRefs ProjectName Source # 
Instance details

Defined in Drasil.System.ProjectName

HasUID ProjectName Source # 
Instance details

Defined in Drasil.System.ProjectName

Methods

uid :: Getter ProjectName UID #

HasProjectName ProjectName Source # 
Instance details

Defined in Drasil.System.ProjectName

Generic ProjectName Source # 
Instance details

Defined in Drasil.System.ProjectName

Associated Types

type Rep ProjectName 
Instance details

Defined in Drasil.System.ProjectName

type Rep ProjectName = D1 ('MetaData "ProjectName" "Drasil.System.ProjectName" "drasil-system-0.1.1.0-9raVnru83quLRW6n1K7zZM" 'False) (C1 ('MetaCons "PN" 'PrefixI 'True) ((S1 ('MetaSel ('Just "_pnUID") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 UID) :*: S1 ('MetaSel ('Just "_title") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 NP)) :*: (S1 ('MetaSel ('Just "_abbreviation") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 String) :*: S1 ('MetaSel ('Just "_repo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 String))))
type Rep ProjectName Source # 
Instance details

Defined in Drasil.System.ProjectName

type Rep ProjectName = D1 ('MetaData "ProjectName" "Drasil.System.ProjectName" "drasil-system-0.1.1.0-9raVnru83quLRW6n1K7zZM" 'False) (C1 ('MetaCons "PN" 'PrefixI 'True) ((S1 ('MetaSel ('Just "_pnUID") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 UID) :*: S1 ('MetaSel ('Just "_title") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 NP)) :*: (S1 ('MetaSel ('Just "_abbreviation") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 String) :*: S1 ('MetaSel ('Just "_repo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 String))))

mkProjectName :: UID -> NP -> String -> (String -> String) -> ProjectName Source #

Construct a ProjectName from a UID, title (NP), abbreviation (String), and repository name formatter ('String -> String'). Errors if the repository name contains characters other than alphanumeric characters or -.

Abbreviation rules: 1. Non-empty, maximum of 64 chars. 2. Only printable characters.

Repo name rules: 1. Non-empty, maximum of 64 chars. 2. Lowercase alphanumeric or - only.

mkCommonProjName :: UID -> NP -> String -> ProjectName Source #

Construct a ProjectName using a common repository name formatting rule (lowercase, naively replace non-alphanumeric characters with -s).

projTitleS :: ProjectName -> Sentence Source #

Get the title of a ProjectName (as a Sentence).

projAbrvS :: ProjectName -> Sentence Source #

Get the human-readable abbreviation of a ProjectName (as a Sentence).

introduceProjName :: ProjectName -> Sentence Source #

Combine a ProjectName's title and abbreviation into an introductory Sentence (e.g. "Title (Abbreviation)").

class (HasSystemMeta sys, HasProjectName sys) => ToFiles sys opts | opts -> sys where Source #

The goal of our systems is to be abstractions about human-readable software artifacts. An instance of this typeclass (ToFiles) defines a software generator that explains how said abstractions can be made fully concrete (i.e., made into concrete software artifacts).

Methods

toFiles Source #

Arguments

:: sys

The system.

-> opts

The generation options.

-> [FileLayout]

The final, rendered software artifacts.