1
1
mirror of https://github.com/github/semantic.git synced 2025-01-03 13:02:37 +03:00

📝 originModule.

This commit is contained in:
Rob Rix 2018-04-02 17:38:16 -04:00
parent 84dc109cde
commit 2c0807f0e5

View File

@ -12,6 +12,7 @@ data Origin term ty where
Module :: Origin term 'P -> M.ModuleInfo -> Origin term 'M
Term :: Origin term 'M -> Base term () -> Origin term 'T
-- | Project the 'ModuleInfo' out of an 'Origin', if available.
originModule :: Origin term ty -> Maybe M.ModuleInfo
originModule (Term o _) = originModule o
originModule (Module _ m) = Just m