1
1
mirror of https://github.com/github/semantic.git synced 2025-01-06 23:46:21 +03:00

Define a helper to construct a package from a list of modules.

This commit is contained in:
Rob Rix 2018-03-30 18:58:23 -04:00
parent be84d9ff78
commit e1f9e34659

View File

@ -2,7 +2,7 @@ module Data.Abstract.Package where
import Data.Abstract.FreeVariables
import Data.Abstract.Module
import Data.Abstract.ModuleTable
import Data.Abstract.ModuleTable as ModuleTable
type PackageName = Name
@ -16,3 +16,7 @@ data Package term = Package
newtype Version = Version { versionString :: String }
deriving (Eq, Ord, Show)
fromModules :: [Module term] -> Package term
fromModules modules = Package Nothing Nothing (ModuleTable.fromModules modules) mempty