-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Types and functions to manipulate the Nixpkgs distribution
--   
--   Types and functions to represent, query, and manipulate the Nixpkgs
--   distribution.
@package distribution-nixpkgs
@version 1.1.1


-- | Render SHA message digests in the peculiar base32'ish format used by
--   Nix.
module Distribution.Nixpkgs.Hashes

-- | Render a SHA265 message digest into the somewhat unusual base32 scheme
--   used by Nix. That algorithm is remarkable, because it twists the bits
--   of the input buffer around quite a bit before grouping them into
--   quintets that are then translated into the target alphabet
--   <tt>0123456789abcdfghijklmnpqrsvwxyz</tt>.
--   
--   Basically, the sequence of bits
--   
--   <pre>
--    255 254 253 252 251 250 249 248   ...   7  6  5  4  3  2  1  0
--   |_______________________________|       |______________________|
--               byte 0                              byte 31
--   </pre>
--   
--   is split into quintets as follows:
--   
--   <pre>
--                 7   6  5  4  3  2   1 0 14 13 12  ...  251 252 253 254 255
--   |______________| |_____________| |____________|     |___________________|
--      quintet 0        quintet 1      quintet 2             quintet 51
--   </pre>
--   
--   before the encoding takes place. This leads to somewhat surprising
--   results:
--   
--   <pre>
--   &gt;&gt;&gt; printSHA256 (packHex "0000000000000000000000000000000000000000000000000000000000000080")
--   "1000000000000000000000000000000000000000000000000000"
--   
--   &gt;&gt;&gt; printSHA256 (packHex "0000000000000000000000000000000000000000000000000000000000000001")
--   "0080000000000000000000000000000000000000000000000000"
--   
--   &gt;&gt;&gt; printSHA256 (packHex "7459ca5c6e117538122f04caf3dbfc58303028c26c58943430c16ff28a3b1d49")
--   "0j8x7f5g4vy160s98n3cq8l30c2qzkdz7jh45w93hx8idrfclnbl"
--   </pre>
printSHA256 :: ByteString -> String

-- | Parse a hexadecimal hash representation into its binary form suitable
--   for encoding with <a>printSHA256</a>.
--   
--   <pre>
--   &gt;&gt;&gt; packHex "48656c6c6f2c20776f726c642e"
--   "Hello, world."
--   </pre>
--   
--   Leading zeros can be omitted, i.e. it's unnecessary to pad the input
--   to an even number of bytes:
--   
--   <pre>
--   &gt;&gt;&gt; packHex "0"
--   "\NUL"
--   </pre>
packHex :: String -> ByteString

module Distribution.Nixpkgs.PackageMap
type PackageMap = Map Identifier (Set Path)
readNixpkgPackageMap :: FilePath -> Maybe Path -> IO PackageMap
resolve :: PackageMap -> Identifier -> Maybe Binding


-- | Internal pretty-printing helpers for Nix expressions.
module Language.Nix.PrettyPrinting
onlyIf :: Bool -> Doc -> Doc
setattr :: String -> Doc -> Set String -> Doc
toAscList :: Set String -> [String]
listattr :: String -> Doc -> [String] -> Doc
boolattr :: String -> Bool -> Bool -> Doc
attr :: String -> Doc -> Doc
string :: String -> Doc
funargs :: [Doc] -> Doc

-- | <i>Note:</i> this class will soon be deprecated. It's not yet, so that
--   we are <tt>-Wall</tt> clean.
class Text a
disp :: Text a => a -> Doc


-- | Known licenses in Nix expressions are represented using the attributes
--   defined in <tt>pkgs/lib/licenses.nix</tt>, and unknown licenses are
--   represented as a literal string.
module Distribution.Nixpkgs.License

-- | The representation for licenses used in Nix derivations. Known
--   licenses are Nix expressions -- such as
--   <tt>stdenv.lib.licenses.bsd3</tt> --, so their exact "name" is not
--   generally known, because the path to <tt>stdenv</tt> depends on the
--   context defined in the expression. In Cabal expressions, for example,
--   the BSD3 license would have to be referred to as
--   <tt>self.stdenv.lib.licenses.bsd3</tt>. Other expressions, however,
--   use different paths to the <tt>licenses</tt> record. Because of tat
--   situation, the library cannot provide an abstract data type that
--   encompasses all known licenses. Instead, the <tt>License</tt> type
--   just distinguishes references to known and unknown licenses. The
--   difference between the two is in the way they are pretty-printed:
--   
--   <pre>
--   &gt; putStrLn (display (Known "stdenv.lib.license.gpl2"))
--   stdenv.lib.license.gpl2
--   
--   &gt; putStrLn (display (Unknown (Just "GPL")))
--   "GPL"
--   
--   &gt; putStrLn (display (Unknown Nothing))
--   "unknown"
--   </pre>
--   
--   Note that the <a>Text</a> instance definition provides
--   pretty-printing, but no parsing as of now!
data License
Known :: String -> License
Unknown :: Maybe String -> License
instance GHC.Generics.Generic Distribution.Nixpkgs.License.License
instance GHC.Classes.Ord Distribution.Nixpkgs.License.License
instance GHC.Classes.Eq Distribution.Nixpkgs.License.License
instance GHC.Show.Show Distribution.Nixpkgs.License.License
instance Text.PrettyPrint.HughesPJClass.Pretty Distribution.Nixpkgs.License.License
instance Control.DeepSeq.NFData Distribution.Nixpkgs.License.License


-- | A representation of the <tt>meta</tt> section used in Nix expressions.
--   A detailed description can be found in section 4, "Meta-attributes",
--   of the Nixpkgs manual at <a>http://nixos.org/nixpkgs/docs.html</a>.
module Distribution.Nixpkgs.Meta

-- | A representation of the <tt>meta</tt> section used in Nix expressions.
--   
--   <pre>
--   &gt;&gt;&gt; :set -XOverloadedStrings
--   
--   &gt;&gt;&gt; :{
--     print (pPrint (Meta "http://example.org" "an example package" (Unknown Nothing)
--                    (Set.singleton (Platform X86_64 Linux))
--                    Set.empty
--                    (Set.fromList ["joe","jane"])
--                    True))
--   :}
--   homepage = "http://example.org";
--   description = "an example package";
--   license = "unknown";
--   platforms = [ "x86_64-linux" ];
--   hydraPlatforms = stdenv.lib.platforms.none;
--   maintainers = with stdenv.lib.maintainers; [ jane joe ];
--   broken = true;
--   </pre>
data Meta
nullMeta :: Meta
homepage :: Lens' Meta String
description :: Lens' Meta String
license :: Lens' Meta License
platforms :: Lens' Meta (Set Platform)
hydraPlatforms :: Lens' Meta (Set Platform)
maintainers :: Lens' Meta (Set Identifier)
broken :: Lens' Meta Bool
allKnownPlatforms :: Set Platform
instance Control.DeepSeq.NFData Distribution.Nixpkgs.Meta.Meta
instance Text.PrettyPrint.HughesPJClass.Pretty Distribution.Nixpkgs.Meta.Meta
instance GHC.Generics.Generic Distribution.Nixpkgs.Meta.Meta
instance GHC.Classes.Ord Distribution.Nixpkgs.Meta.Meta
instance GHC.Classes.Eq Distribution.Nixpkgs.Meta.Meta
instance GHC.Show.Show Distribution.Nixpkgs.Meta.Meta
