Take monadic type out of the Context module to wait for Module data structure to be defined and enhanced with priorities and all

This commit is contained in:
Tissevert 2020-01-01 10:16:15 +01:00
parent 12fb295610
commit 7cf2f84dae

View file

@ -1,14 +1,11 @@
module Context (
CodePath(..)
, Context(..)
, Contextual
, Path(..)
, packages
) where
import Control.Monad.RWS (RWST)
import Data.List (intercalate)
import Data.Map (Map)
import System.Directory (doesDirectoryExist)
import System.Environment (lookupEnv)
import System.FilePath ((</>))
@ -17,17 +14,14 @@ import Text.ParserCombinators.ReadP (char, munch, sepBy)
import Text.ParserCombinators.ReadPrec (lift)
import Text.Read (readPrec)
newtype Path = Path [String]
newtype Path = Path [String] deriving (Eq, Ord)
newtype CodePath = CodePath [FilePath]
type Dependencies = Map Path [Path]
data Context = Context {
codePaths :: CodePath
, mainModule :: Path
}
type Contextual = RWST Context [String] Dependencies IO
instance Show Path where
show (Path components) = intercalate "." components