Utils.hs 411 Bytes
Newer Older
mnislaih's avatar
mnislaih committed
1
2
module Network.Hackage.CabalInstall.Utils where

3
import Distribution.Compat.ReadP (ReadP, readP_to_S)
mnislaih's avatar
mnislaih committed
4
5
6
import Distribution.Verbosity
import Network.Hackage.CabalInstall.Types

7
8
import Data.Char (isSpace)
import Data.Maybe (listToMaybe)
mnislaih's avatar
mnislaih committed
9
10


11
12
13
14
isVerbose cfg = configVerbose cfg >= verbose

readPToMaybe :: ReadP r a -> String -> Maybe a
readPToMaybe p str = listToMaybe [ r | (r,s) <- readP_to_S p str, all isSpace s ]