spdx-license-0.1.1: SPDX license templates
Safe HaskellNone
LanguageHaskell2010

Distribution.SPDX.Template

Description

Parsing, pretty-printing and rendering of SPDX license templates

Synopsis

Documentation

newtype License Source #

Constructors

License [Piece] 

Instances

Instances details
Eq License Source # 
Instance details

Defined in Distribution.SPDX.Template

Methods

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

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

Show License Source # 
Instance details

Defined in Distribution.SPDX.Template

Generic License Source # 
Instance details

Defined in Distribution.SPDX.Template

Associated Types

type Rep License :: Type -> Type #

Methods

from :: License -> Rep License x #

to :: Rep License x -> License #

type Rep License Source # 
Instance details

Defined in Distribution.SPDX.Template

type Rep License = D1 ('MetaData "License" "Distribution.SPDX.Template" "spdx-license-0.1.1-5WmnjvMQbsB7NfnqsLYSWX" 'True) (C1 ('MetaCons "License" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Piece])))

data Piece Source #

Constructors

Substansive Text 
Optional [Piece] 
Var 

Fields

Instances

Instances details
Eq Piece Source # 
Instance details

Defined in Distribution.SPDX.Template

Methods

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

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

Show Piece Source # 
Instance details

Defined in Distribution.SPDX.Template

Methods

showsPrec :: Int -> Piece -> ShowS #

show :: Piece -> String #

showList :: [Piece] -> ShowS #

Generic Piece Source # 
Instance details

Defined in Distribution.SPDX.Template

Associated Types

type Rep Piece :: Type -> Type #

Methods

from :: Piece -> Rep Piece x #

to :: Rep Piece x -> Piece #

type Rep Piece Source # 
Instance details

Defined in Distribution.SPDX.Template

data SubstitutionError Source #

Constructors

RegexNoMatch 

Fields

Instances

Instances details
Eq SubstitutionError Source # 
Instance details

Defined in Distribution.SPDX.Template

Show SubstitutionError Source # 
Instance details

Defined in Distribution.SPDX.Template

Generic SubstitutionError Source # 
Instance details

Defined in Distribution.SPDX.Template

Associated Types

type Rep SubstitutionError :: Type -> Type #

type Rep SubstitutionError Source # 
Instance details

Defined in Distribution.SPDX.Template

type Rep SubstitutionError = D1 ('MetaData "SubstitutionError" "Distribution.SPDX.Template" "spdx-license-0.1.1-5WmnjvMQbsB7NfnqsLYSWX" 'False) (C1 ('MetaCons "RegexNoMatch" 'PrefixI 'True) ((S1 ('MetaSel ('Just "name") 'SourceUnpack 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "original") 'SourceUnpack 'NoSourceStrictness 'DecidedStrict) (Rec0 Text)) :*: (S1 ('MetaSel ('Just "match") 'SourceUnpack 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "target") 'SourceUnpack 'NoSourceStrictness 'DecidedStrict) (Rec0 Text))))

license :: Parser License Source #

License parser

prettyLicense :: License -> Text Source #

Pretty-print a license template

render :: Map Text Text -> License -> Either SubstitutionError Text Source #

Render a license from a context, if a var is not in the context, the original value will be used

unsafeRender :: Map Text Text -> License -> Text Source #

Render a license without checking whether the texts match the regexes