The representation for licenses used in Nix derivations. Known
licenses are Nix expressions — such as lib.licenses.bsd3 —,
so their exact name is not generally known, because the path
to lib depends on the context defined in the expression.
In Cabal expressions, for example, the BSD3 license would have to be
referred to as self.lib.licenses.bsd3. Other expressions,
however, use different paths to the licenses record. Because of that
situation, the library cannot provide an abstract data type that
encompasses all known licenses.
Instead, the License type just distinguishes references to known
and unknown licenses. The difference between the two is in the way
they are pretty-printed:
putStrLn (prettyShow (Known "lib.license.gpl2"))lib.license.gpl2putStrLn (prettyShow (Unknown (Just "GPL")))"GPL"putStrLn (prettyShow (Unknown Nothing))"unknown"
Note that the Pretty instance definition provides pretty-printing, but no parsing as of now!
Instances7Eq, Ord, Show, Generic, NFData, Pretty, …
Eq LicenseDefined in distribution-nixpkgs-1.7.1.1 · Distribution.Nixpkgs.LicenseOrd LicenseDefined in distribution-nixpkgs-1.7.1.1 · Distribution.Nixpkgs.LicenseShow LicenseDefined in distribution-nixpkgs-1.7.1.1 · Distribution.Nixpkgs.LicenseGeneric LicenseDefined in distribution-nixpkgs-1.7.1.1 · Distribution.Nixpkgs.LicenseNFData LicenseDefined in distribution-nixpkgs-1.7.1.1 · Distribution.Nixpkgs.LicensePretty LicenseDefined in distribution-nixpkgs-1.7.1.1 · Distribution.Nixpkgs.Licensetype Rep License = D1 ('MetaDataDefined in distribution-nixpkgs-1.7.1.1 · Distribution.Nixpkgs.License"License"
"Distribution.Nixpkgs.License"
"distribution-nixpkgs-1.7.1.1-8IOhVguqKxDLSo8gK7ToQB"
'False) (C1 ('MetaCons"Known"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)) :+: C1 ('MetaCons"Unknown"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe String))))