diff --git a/src/Juvix/Compiler/Nockma/Language.hs b/src/Juvix/Compiler/Nockma/Language.hs index f04a2a69db..657d894c45 100644 --- a/src/Juvix/Compiler/Nockma/Language.hs +++ b/src/Juvix/Compiler/Nockma/Language.hs @@ -56,7 +56,7 @@ data StdlibCall a = StdlibCall deriving stock (Show, Eq, Lift) data CellInfo a = CellInfo - { _cellInfoLoc :: Maybe Interval, + { _cellInfoLoc :: Irrelevant (Maybe Interval), _cellInfoCall :: Maybe (StdlibCall a) } deriving stock (Show, Eq, Lift) @@ -70,7 +70,7 @@ data Cell a = Cell' data AtomInfo = AtomInfo { _atomInfoHint :: Maybe AtomHint, - _atomInfoLoc :: Maybe Interval + _atomInfoLoc :: Irrelevant (Maybe Interval) } deriving stock (Show, Eq, Lift) @@ -183,13 +183,13 @@ termLoc f = \case TermCell a -> TermCell <$> cellLoc f a cellLoc :: Lens' (Cell a) (Maybe Interval) -cellLoc = cellInfo . cellInfoLoc +cellLoc = cellInfo . cellInfoLoc . unIrrelevant cellCall :: Lens' (Cell a) (Maybe (StdlibCall a)) cellCall = cellInfo . cellInfoCall atomLoc :: Lens' (Atom a) (Maybe Interval) -atomLoc = atomInfo . atomInfoLoc +atomLoc = atomInfo . atomInfoLoc . unIrrelevant naturalNockOps :: HashMap Natural NockOp naturalNockOps = HashMap.fromList [(serializeOp op, op) | op <- allElements] @@ -354,14 +354,14 @@ emptyCellInfo :: CellInfo a emptyCellInfo = CellInfo { _cellInfoCall = Nothing, - _cellInfoLoc = Nothing + _cellInfoLoc = Irrelevant Nothing } emptyAtomInfo :: AtomInfo emptyAtomInfo = AtomInfo { _atomInfoHint = Nothing, - _atomInfoLoc = Nothing + _atomInfoLoc = Irrelevant Nothing } class NockmaEq a where diff --git a/src/Juvix/Compiler/Nockma/Translation/FromSource/Base.hs b/src/Juvix/Compiler/Nockma/Translation/FromSource/Base.hs index 46bb99ce97..c508547913 100644 --- a/src/Juvix/Compiler/Nockma/Translation/FromSource/Base.hs +++ b/src/Juvix/Compiler/Nockma/Translation/FromSource/Base.hs @@ -82,7 +82,7 @@ atomOp = do let info = AtomInfo { _atomInfoHint = Just AtomHintOp, - _atomInfoLoc = Just loc + _atomInfoLoc = Irrelevant (Just loc) } return (Atom (serializeNockOp op') info) @@ -95,7 +95,7 @@ atomDirection = do let info = AtomInfo { _atomInfoHint = Just AtomHintOp, - _atomInfoLoc = Just loc + _atomInfoLoc = Irrelevant (Just loc) } return (Atom (serializePath dirs) info) @@ -105,7 +105,7 @@ atomNat = do let info = AtomInfo { _atomInfoHint = Nothing, - _atomInfoLoc = Just loc + _atomInfoLoc = Irrelevant (Just loc) } return (Atom n info) @@ -150,7 +150,7 @@ cell = do info = CellInfo { _cellInfoCall = c, - _cellInfoLoc = Just (lloc <> rloc) + _cellInfoLoc = Irrelevant (Just (lloc <> rloc)) } return (set cellInfo info r) where