Skip to content

Commit

Permalink
Update Typed.ReplTopLevel to match IR structure, reusing the TopLevel…
Browse files Browse the repository at this point in the history
… type
  • Loading branch information
0xd34df00d committed Oct 11, 2023
1 parent 9f62b8c commit 8c63652
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
6 changes: 1 addition & 5 deletions typed-core/Pact/Core/IR/Typecheck.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1546,11 +1546,7 @@ inferReplTopLevel = \case
-- repl defuns and defconsts will break invariants about
IR.RTLDefun dfn -> Typed.RTLDefun <$> inferDefun dfn
IR.RTLDefConst dconst -> Typed.RTLDefConst <$> inferDefConst dconst
IR.RTLTopLevel tl ->
case tl of
IR.TLModule m -> Typed.RTLModule <$> inferModule m
IR.TLTerm t -> Typed.RTLTerm . snd <$> inferTermNonGen t
IR.TLInterface i -> Typed.RTLInterface <$> inferInterface i
IR.RTLTopLevel tl -> Typed.RTLTopLevel <$> inferTopLevel tl

-- | Transform types into their debruijn-indexed version
-- Essentially: Start at depth 0:
Expand Down
5 changes: 2 additions & 3 deletions typed-core/Pact/Core/Typed/Term.hs
Original file line number Diff line number Diff line change
Expand Up @@ -184,14 +184,13 @@ data TopLevel name tyname builtin info
= TLModule (Module name tyname builtin info)
| TLInterface (Interface name tyname builtin info)
| TLTerm (Term name tyname builtin info)
| TLUse Import
deriving Show

data ReplTopLevel name tyname builtin info
= RTLModule (Module name tyname builtin info)
| RTLInterface (Interface name tyname builtin info)
= RTLTopLevel (TopLevel name tyname builtin info)
| RTLDefun (Defun name tyname builtin info)
| RTLDefConst (DefConst name tyname builtin info)
| RTLTerm (Term name tyname builtin info)
deriving Show

-- | Typed pact core terms
Expand Down

0 comments on commit 8c63652

Please sign in to comment.