There is a strange pattern matching in the code that defines the function (cradleRootDir -> projdir)
I assume this is intended to use the inline function and associates the result with the name projdir .
What is the name of this design?
withGhcModEnv' :: (IOish m, GmOut m) => (FilePath -> (Cradle -> ma) -> ma) -> FilePath -> Options -> ((GhcModEnv, GhcModLog) -> ma) -> ma withGhcModEnv' withCradle dir opts f = withCradle dir $ \crdl -> withCradleRootDir crdl $ f (GhcModEnv opts crdl, undefined) where withCradleRootDir (cradleRootDir -> projdir) a = do cdir <- liftIO $ getCurrentDirectory eq <- liftIO $ pathsEqual projdir cdir if not eq then throw $ GMEWrongWorkingDirectory projdir cdir else a
Constructor
data Cradle = Cradle { cradleCurrentDir :: FilePath , cradleRootDir :: FilePath , cradleCabalFile :: Maybe FilePath , cradlePkgDbStack :: [GhcPkgDb] } deriving (Eq, Show)
haskell
nicolas
source share