Dont use Applicative ReadP instance

This commit is contained in:
Daniel Gröber 2014-04-18 00:15:50 +02:00
parent 1639a7b2e0
commit bd2db5e98e

View File

@ -11,7 +11,7 @@ module Language.Haskell.GhcMod.GhcPkg (
) where ) where
import Config (cProjectVersionInt) -- ghc version import Config (cProjectVersionInt) -- ghc version
import Control.Applicative ((<$>), (<*)) import Control.Applicative ((<$>))
import Control.Exception (SomeException(..)) import Control.Exception (SomeException(..))
import qualified Control.Exception as E import qualified Control.Exception as E
import Data.Char (isSpace,isAlphaNum) import Data.Char (isSpace,isAlphaNum)
@ -90,9 +90,11 @@ data PackageState = Normal | Hidden | Broken deriving (Eq,Show)
packageLineP :: ReadP (PackageState, Package) packageLineP :: ReadP (PackageState, Package)
packageLineP = do packageLineP = do
skipSpaces skipSpaces
choice [ (Hidden,) <$> between (char '(') (char ')') packageP p <- choice [ (Hidden,) <$> between (char '(') (char ')') packageP
, (Broken,) <$> between (char '{') (char '}') packageP , (Broken,) <$> between (char '{') (char '}') packageP
, (Normal,) <$> packageP ] <* eof , (Normal,) <$> packageP ]
eof
return p
packageP :: ReadP (PackageBaseName, PackageVersion, PackageId) packageP :: ReadP (PackageBaseName, PackageVersion, PackageId)
packageP = do packageP = do