Skip to content

Commit

Permalink
clean
Browse files Browse the repository at this point in the history
  • Loading branch information
janmasrovira committed Oct 1, 2024
1 parent 3f8df1a commit cb13775
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
12 changes: 6 additions & 6 deletions src/Juvix/Compiler/Concrete/Data/NameSignature/Builder.hs
Original file line number Diff line number Diff line change
Expand Up @@ -198,15 +198,15 @@ addSigArg a = case a ^. sigArgNames of
defaultType = run (runReader (getLoc a) Gen.smallUniverseExpression)

addArg :: Argument s -> Sem r ()
addArg arg =
addArg arg = do
let sym :: Maybe (SymbolType s) = case arg of
ArgumentSymbol sy -> Just sy
ArgumentWildcard {} -> Nothing
in addArgument
(a ^. sigArgImplicit)
(a ^. sigArgDefault)
sym
(fromMaybe defaultType (a ^. sigArgType))
addArgument
(a ^. sigArgImplicit)
(a ^. sigArgDefault)
sym
(fromMaybe defaultType (a ^. sigArgType))

type Re s r = State (BuilderState s) ': Error (BuilderState s) ': Error NameSignatureError ': r

Expand Down
9 changes: 2 additions & 7 deletions src/Juvix/Compiler/Concrete/Language/Base.hs
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ type ParsedPragmas = WithLoc (WithSource Pragmas)
data NameItem (s :: Stage) = NameItem
{ -- | The symbol cannot be omitted for explicit arguments
_nameItemSymbol :: Maybe (SymbolType s),
-- | NOTE the index is wrt to the block, not the whole signature
_nameItemIndex :: Int,
_nameItemImplicit :: IsImplicit,
_nameItemType :: ExpressionType s,
Expand All @@ -174,12 +175,7 @@ instance Serialize (NameItem 'Parsed)
instance NFData (NameItem 'Parsed)

data NameBlock (s :: Stage) = NameBlock
{ -- | NOTE the index is wrt to the block, not the whole signature.
_nameBlockItems :: NonEmpty (NameItem s),
-- | The number of elements in this block. It cannot be 0. It may be
-- different than the size of _nameBlock because we may omit the argument
-- name in Implicit or ImplicitInstance arguments.
-- _nameBlockSize :: Int,
{ _nameBlockItems :: NonEmpty (NameItem s),
_nameBlockImplicit :: IsImplicit
}
deriving stock (Generic)
Expand Down Expand Up @@ -3523,7 +3519,6 @@ fromParsedIteratorInfo ParsedIteratorInfo {..} =
_iteratorInfoRangeNum = (^. withLocParam) <$> _parsedIteratorInfoRangeNum
}

-- | The returned list has _nameBlockSize items
nameBlockSymbols :: forall s. Traversal' (NameBlock s) (SymbolType s)
nameBlockSymbols = nameBlockItems . each . nameItemSymbol . _Just

Expand Down

0 comments on commit cb13775

Please sign in to comment.