-- | Is the given package/version combo defined in the snapshot?
inSnapshot :: PackageName -> Version -> M Bool
inSnapshot name version = do
    p <- asks ls
    ls <- asks localNames
    return $ fromMaybe False $ do
        guard $ not $ name `Set.member` ls
        lpi <- Map.lookup name (lsPackages p)
        return $ lpiVersion lpi == version
inSnapshot :: PackageName -> Version -> M Bool
inSnapshot name version = do
    p <- asks ls
    ls <- asks localNames
    return $ fromMaybe False $ do
        guard $ not $ name `Set.member` ls
        lpi <- Map.lookup name (lsPackages p)
        return $ lpiVersion lpi == version
inSnapshot name version = do
    p <- asks ls
    ls <- asks localNames
    return $ fromMaybe False $ do
        guard $ not $ name `Set.member` ls
        lpi <- Map.lookup name (lsPackages p)
        return $ lpiVersion lpi == version