Cabal-syntax-3.12.1.0: A library for working with .cabal files

Safe Haskell | None
Language | Haskell2010

Distribution.SPDX.License

Synopsis

- data License
  - = NONE
  - | License LicenseExpression

# Documentation

data License Source #

Declared license. See section 3.15 of SPDX Specification 2.1

Note: the NOASSERTION case is omitted.

Old `License` can be migrated using following rules:

- `AllRightsReserved` and `UnspecifiedLicense` to `NONE`. No license specified which legally defaults to All Rights Reserved. The package may not be legally modified or redistributed by anyone but the rightsholder.
- `OtherLicense` can be converted to `LicenseRef` pointing to the file in the package.
- `UnknownLicense` i.e. other licenses of the form `name-x.y`, should be covered by SPDX license list, otherwise use `LicenseRef`.
- `PublicDomain` isn't covered. Consider using CC0. See https://wiki.spdx.org/view/Legal_Team/Decisions/Dealing_with_Public_Domain_within_SPDX_Files for more information.

Constructors

NONE | if the package contains no license information whatsoever; or
License LicenseExpression | A valid SPDX License Expression as defined in Appendix IV.

#### Instances

Instances details

Parsec License Source #

    >>> eitherParsec "BSD-3-Clause AND MIT" :: Either String License
    Right (License (EAnd (ELicense (ELicenseId BSD_3_Clause) Nothing) (ELicense (ELicenseId MIT) Nothing)))

    >>> eitherParsec "NONE" :: Either String License
    Right NONE

Instance details Defined in Distribution.SPDX.License Methods parsec :: CabalParsing m => m License Source #
Pretty License Source # |
Instance details Defined in Distribution.SPDX.License Methods pretty :: License -> Doc Source # prettyVersioned :: CabalSpecVersion -> License -> Doc Source #
Structured License Source # |
Instance details Defined in Distribution.SPDX.License Methods structure :: Proxy License -> Structure Source # structureHash' :: Tagged License MD5
Binary License Source # |
Instance details Defined in Distribution.SPDX.License Methods put :: License -> Put Source # get :: Get License Source # putList :: [License] -> Put Source #
NFData License Source # |
Instance details Defined in Distribution.SPDX.License Methods rnf :: License -> () Source #
Data License Source # |

Instance details

Defined in Distribution.SPDX.License

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> License -> c License #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c License #

toConstr :: License -> Constr #

dataTypeOf :: License -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c License) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c License) #

gmapT :: (forall b. Data b => b -> b) -> License -> License #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> License -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> License -> r #

gmapQ :: (forall d. Data d => d -> u) -> License -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> License -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> License -> m License #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> License -> m License #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> License -> m License #

Generic License Source # |

Instance details

Defined in Distribution.SPDX.License

Associated Types

type Rep License |
Instance details Defined in Distribution.SPDX.License type Rep License = D1 ('MetaData "License" "Distribution.SPDX.License" "Cabal-syntax-3.12.1.0-5c0e" 'False) (C1 ('MetaCons "NONE" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "License" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 LicenseExpression)))

Methods

from :: License -> Rep License x #

to :: Rep License x -> License #

Read License Source # |
Instance details Defined in Distribution.SPDX.License Methods readsPrec :: Int -> ReadS License # readList :: ReadS [License] # readPrec :: ReadPrec License # readListPrec :: ReadPrec [License] #
Show License Source # |
Instance details Defined in Distribution.SPDX.License Methods showsPrec :: Int -> License -> ShowS # show :: License -> String # showList :: [License] -> ShowS #
Eq License Source # |
Instance details Defined in Distribution.SPDX.License Methods (==) :: License -> License -> Bool # (/=) :: License -> License -> Bool #
Ord License Source # |
Instance details Defined in Distribution.SPDX.License Methods compare :: License -> License -> Ordering # (<) :: License -> License -> Bool # (<=) :: License -> License -> Bool # (>) :: License -> License -> Bool # (>=) :: License -> License -> Bool # max :: License -> License -> License # min :: License -> License -> License #
Newtype (Either License License) SpecLicense Source # |
Instance details Defined in Distribution.FieldGrammar.Newtypes Methods pack :: Either License License -> SpecLicense Source # unpack :: SpecLicense -> Either License License Source #
type Rep License Source # |
Instance details Defined in Distribution.SPDX.License type Rep License = D1 ('MetaData "License" "Distribution.SPDX.License" "Cabal-syntax-3.12.1.0-5c0e" 'False) (C1 ('MetaCons "NONE" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "License" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 LicenseExpression)))