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

Define a helper to construct ModuleInfo from a SrcLoc.

This commit is contained in:
Rob Rix 2018-05-09 15:53:59 -04:00
parent 5c3543e61f
commit 22bb253a3c

View File

@ -3,9 +3,11 @@ module Data.Abstract.Module
, moduleForBlob
, ModulePath
, ModuleInfo(..)
, moduleInfoFromSrcLoc
) where
import Data.Blob
import GHC.Stack
import Prologue
import System.FilePath.Posix
@ -30,3 +32,6 @@ type ModulePath = FilePath
newtype ModuleInfo = ModuleInfo { modulePath :: ModulePath }
deriving (Eq, Ord, Show)
moduleInfoFromSrcLoc :: SrcLoc -> ModuleInfo
moduleInfoFromSrcLoc = ModuleInfo . srcLocModule