hie-bios
Safe HaskellSafe-Inferred
LanguageHaskell2010

HIE.Bios.Cradle.Utils

Synopsis

Helper for process errors

data ProcessErrorDetails Source #

Constructors

ProcessErrorDetails 

Fields

Cradle utils

selectCradle :: (a -> FilePath) -> FilePath -> [a] -> Maybe a Source #

Given a list of cradles, try to find the most likely cradle that this FilePath belongs to.

Processing of ghc-options

removeRTS :: [String] -> [String] Source #

Strip out any ["+RTS", ..., "-RTS"] sequences in the command string list.

>>> removeRTS ["option1", "+RTS -H32m -RTS", "option2"]
["option1", "option2"]
>>> removeRTS ["option1", "+RTS", "-H32m", "-RTS", "option2"]
["option1", "option2"]
>>> removeRTS ["option1", "+RTS -H32m"]
["option1"]
>>> removeRTS ["option1", "+RTS -H32m", "-RTS", "option2"]
["option1", "option2"]
>>> removeRTS ["option1", "+RTS -H32m", "-H32m -RTS", "option2"]
["option1", "option2"]