From d2e32fd50b91350204864dfc7324be34d44b0a6b Mon Sep 17 00:00:00 2001 From: joshvera Date: Tue, 24 Apr 2018 16:19:54 -0400 Subject: [PATCH] go is really about entryPoints --- src/Data/Abstract/Package.hs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/Data/Abstract/Package.hs b/src/Data/Abstract/Package.hs index 5b5d26cca..9b2ec4dda 100644 --- a/src/Data/Abstract/Package.hs +++ b/src/Data/Abstract/Package.hs @@ -34,10 +34,7 @@ data Package term = Package deriving (Eq, Functor, Ord, Show) fromModules :: PackageName -> Maybe Version -> Maybe (Module term) -> Int -> [Module term] -> Package term -fromModules name version prelude entryPoints = Package (PackageInfo name version) . go prelude +fromModules name version prelude entryPoints modules = + Package (PackageInfo name version) (PackageBody (ModuleTable.fromModules modules) prelude entryPoints') where - go :: Maybe (Module term) -> [Module term] -> PackageBody term - go p [] = PackageBody mempty p mempty - go p modules = PackageBody (ModuleTable.fromModules modules) p entryPoints' - where - entryPoints' = ModuleTable . Map.fromList $ (,Nothing) . modulePath . moduleInfo <$> if entryPoints == 0 then modules else (take entryPoints modules) + entryPoints' = ModuleTable . Map.fromList $ (,Nothing) . modulePath . moduleInfo <$> if entryPoints == 0 then modules else (take entryPoints modules)