Skip to content

Commit

Permalink
Restore previous version of ImportParents
Browse files Browse the repository at this point in the history
  • Loading branch information
paulcadman committed Apr 25, 2024
1 parent accdb35 commit 34375f7
Showing 1 changed file with 3 additions and 17 deletions.
20 changes: 3 additions & 17 deletions src/Juvix/Compiler/Pipeline/ImportParents.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,9 @@ module Juvix.Compiler.Pipeline.ImportParents where
import Juvix.Compiler.Concrete.Data
import Juvix.Prelude.Base

data ImportParents = ImportParents
{ _importParents :: [TopModulePath],
_importParentsSeenModules :: HashSet TopModulePath
newtype ImportParents = ImportParents
{ _importParents :: [TopModulePath]
}
deriving newtype (Semigroup, Monoid)

makeLenses ''ImportParents

instance Semigroup ImportParents where
s1 <> s2 =
ImportParents
{ _importParents = s1 ^. importParents <> s2 ^. importParents,
_importParentsSeenModules = s1 ^. importParentsSeenModules <> s2 ^. importParentsSeenModules
}

instance Monoid ImportParents where
mempty =
ImportParents
{ _importParents = mempty,
_importParentsSeenModules = mempty
}

0 comments on commit 34375f7

Please sign in to comment.