1{-# LANGUAGE NoImplicitPrelude #-}
2{-# LANGUAGE OverloadedStrings #-}
3module Stackage2.CorePackages
7import qualified Data.Text as T
8import Stackage2.Prelude
10-- | Get a @Map@ of all of the core packages. Core packages are defined as
11-- packages which ship with GHC itself.
13-- Precondition: GHC global package database has only core packages, and GHC
14-- ships with just a single version of each packages.
15getCorePackages :: IO (Map PackageName Version)
17 withCheckedProcess cp $ \ClosedStream src Inherited ->
18 src $$ decodeUtf8C =$ linesUnboundedC =$ foldMapMC parsePackage
20 cp = proc "ghc-pkg" ["--no-user-package-conf", "list"]
22 | ":" `isInfixOf` t = return mempty
23 | Just p <- stripSuffix "-" p' = singletonMap
26 | otherwise = return mempty
28 (p', v) = T.breakOnEnd "-" $ dropParens $ T.strip t
31 | length s > 2 && headEx s == '(' && lastEx s == ')' =
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list