1
1
mirror of https://github.com/github/semantic.git synced 2024-12-23 23:11:50 +03:00

Move ModulePath & ModuleInfo down.

This commit is contained in:
Rob Rix 2018-05-09 15:45:15 -04:00
parent 924aa3e243
commit 042a3077ea

View File

@ -1,19 +1,14 @@
module Data.Abstract.Module
( Module(..)
, ModuleInfo(..)
, ModulePath
, moduleForBlob
, ModulePath
, ModuleInfo(..)
) where
import Data.Blob
import Prologue
import System.FilePath.Posix
type ModulePath = FilePath
newtype ModuleInfo = ModuleInfo { modulePath :: ModulePath }
deriving (Eq, Ord, Show)
data Module term = Module { moduleInfo :: ModuleInfo, moduleBody :: term }
deriving (Eq, Foldable, Functor, Ord, Traversable)
@ -29,3 +24,9 @@ moduleForBlob :: Maybe FilePath -- ^ The root directory relative to which the mo
moduleForBlob rootDir Blob{..} = Module info
where root = fromMaybe (takeDirectory blobPath) rootDir
info = ModuleInfo (makeRelative root blobPath)
type ModulePath = FilePath
newtype ModuleInfo = ModuleInfo { modulePath :: ModulePath }
deriving (Eq, Ord, Show)