From 8c63652dc536977e747b4fc390c60dc044d0e4a3 Mon Sep 17 00:00:00 2001 From: 0xd34df00d <0xd34df00d@gmail.com> Date: Wed, 11 Oct 2023 16:14:51 -0500 Subject: [PATCH] Update Typed.ReplTopLevel to match IR structure, reusing the TopLevel type --- typed-core/Pact/Core/IR/Typecheck.hs | 6 +----- typed-core/Pact/Core/Typed/Term.hs | 5 ++--- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/typed-core/Pact/Core/IR/Typecheck.hs b/typed-core/Pact/Core/IR/Typecheck.hs index 1c4676c58..a2ea3419c 100644 --- a/typed-core/Pact/Core/IR/Typecheck.hs +++ b/typed-core/Pact/Core/IR/Typecheck.hs @@ -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: diff --git a/typed-core/Pact/Core/Typed/Term.hs b/typed-core/Pact/Core/Typed/Term.hs index 1a0721271..186eef802 100644 --- a/typed-core/Pact/Core/Typed/Term.hs +++ b/typed-core/Pact/Core/Typed/Term.hs @@ -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