1
1
mirror of https://github.com/github/semantic.git synced 2024-12-24 07:25:44 +03:00

📝 the arguments to moduleForBlob.

This commit is contained in:
Rob Rix 2018-03-21 19:55:01 -04:00
parent 842ab3403d
commit da02fc870d

View File

@ -18,7 +18,10 @@ data Module term = Module { moduleName :: ModuleName, modulePath :: FilePath, mo
-- | Construct a 'Module' for a 'Blob' and @term@, relative to some root 'FilePath'. -- | Construct a 'Module' for a 'Blob' and @term@, relative to some root 'FilePath'.
moduleForBlob :: FilePath -> Blob -> term -> Module term moduleForBlob :: FilePath -- ^ The root directory relative to which the module will be resolved.
-> Blob -- ^ The 'Blob' containing the module.
-> term -- ^ The @term@ representing the body of the module.
-> Module term -- ^ A 'Module' named appropriate for the 'Blob', holding the @term@, and constructed relative to the root 'FilePath'.
moduleForBlob rootDir blob term = Module (moduleName blob) (blobPath blob) term moduleForBlob rootDir blob term = Module (moduleName blob) (blobPath blob) term
where moduleName Blob{..} = let path = dropExtensions (makeRelative rootDir blobPath) where moduleName Blob{..} = let path = dropExtensions (makeRelative rootDir blobPath)
in case blobLanguage of in case blobLanguage of