1
1
mirror of https://github.com/github/semantic.git synced 2024-12-19 12:51:52 +03:00

📝 moduleForBlob.

This commit is contained in:
Rob Rix 2018-03-21 19:52:52 -04:00
parent 7e2b8b93e4
commit 842ab3403d

View File

@ -17,6 +17,7 @@ data Module term = Module { moduleName :: ModuleName, modulePath :: FilePath, mo
deriving (Eq, Foldable, Functor, Ord, Show, Traversable)
-- | Construct a 'Module' for a 'Blob' and @term@, relative to some root 'FilePath'.
moduleForBlob :: FilePath -> Blob -> term -> Module term
moduleForBlob rootDir blob term = Module (moduleName blob) (blobPath blob) term
where moduleName Blob{..} = let path = dropExtensions (makeRelative rootDir blobPath)