diff --git a/src/Distribution/Nixpkgs/PackageMap.hs b/src/Distribution/Nixpkgs/PackageMap.hs index c905472..08b7c4a 100644 --- a/src/Distribution/Nixpkgs/PackageMap.hs +++ b/src/Distribution/Nixpkgs/PackageMap.hs @@ -28,8 +28,10 @@ type PackageMap = Map Identifier (Set Path) -- Note: Evaluation of nixpkgs is very expensive (takes multiple -- seconds), so cache the result of this function if possible. -- --- >>> readNixpkgPackageMap "" (Just "{ config = { allowAliases = false; }; }") +-- @ +-- >>> readNixpkgPackageMap "\" (Just "{ config = { allowAliases = false; }; }") -- fromList [ … ] +-- @ readNixpkgPackageMap :: String -- ^ Path to nixpkgs, must be a valid nix path -- (absolute, relative or @NIX_PATH@ lookup) @@ -77,8 +79,10 @@ parsePackage x -- | Finds the shortest 'Path' in a 'PackageMap' that has the -- given 'Identifier' as its last component. -- +-- @ -- >>> resolve nixpkgs (ident # "pam") -- Just (Bind (Identifier "pam") (Path [Identifier "pam"])) +-- @ resolve :: PackageMap -> Identifier -> Maybe Binding resolve nixpkgs i = case Map.lookup i nixpkgs of Nothing -> Nothing