mirror of
https://github.com/github/semantic.git
synced 2024-12-01 00:33:59 +03:00
Move the SomeOrigin constructors down next to SomeOrigin.
This commit is contained in:
parent
e03461819c
commit
92116753dd
@ -11,15 +11,6 @@ data Origin term ty where
|
||||
Module :: Origin term 'P -> M.ModuleInfo -> Origin term 'M
|
||||
Term :: Origin term 'M -> Base term () -> Origin term 'T
|
||||
|
||||
packageOrigin :: P.Package term -> SomeOrigin term
|
||||
packageOrigin = SomeOrigin . Package . P.packageInfo
|
||||
|
||||
moduleOrigin :: M.Module term -> SomeOrigin term
|
||||
moduleOrigin = SomeOrigin . Module Unknown . M.moduleInfo
|
||||
|
||||
termOrigin :: Recursive term => term -> SomeOrigin term
|
||||
termOrigin = SomeOrigin . Term Unknown . (() <$) . project
|
||||
|
||||
originModule :: Origin term ty -> Maybe M.ModuleInfo
|
||||
originModule (Term o _) = originModule o
|
||||
originModule (Module _ m) = Just m
|
||||
@ -62,6 +53,15 @@ data OriginType = P | M | T
|
||||
data SomeOrigin term where
|
||||
SomeOrigin :: Origin term ty -> SomeOrigin term
|
||||
|
||||
packageOrigin :: P.Package term -> SomeOrigin term
|
||||
packageOrigin = SomeOrigin . Package . P.packageInfo
|
||||
|
||||
moduleOrigin :: M.Module term -> SomeOrigin term
|
||||
moduleOrigin = SomeOrigin . Module Unknown . M.moduleInfo
|
||||
|
||||
termOrigin :: Recursive term => term -> SomeOrigin term
|
||||
termOrigin = SomeOrigin . Term Unknown . (() <$) . project
|
||||
|
||||
withSomeOrigin :: (forall ty . Origin term ty -> b) -> SomeOrigin term -> b
|
||||
withSomeOrigin with (SomeOrigin o) = with o
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user