From d96f9fb984d7f3e3ee2b5f61cd18568a175047be Mon Sep 17 00:00:00 2001 From: effectfully Date: Sat, 24 Jul 2021 01:14:42 +0300 Subject: [PATCH] Fixed warnings, fixed 'stack.yaml' --- cabal.project | 4 ---- .../src/PlutusIR/Core/Instance/Scoping.hs | 12 ++++++------ .../plutus-ir/src/PlutusIR/Transform/Rename.hs | 15 ++++++--------- stack.yaml | 14 ++++++++++---- 4 files changed, 22 insertions(+), 23 deletions(-) diff --git a/cabal.project b/cabal.project index 875a4c5a3ba..2e4f9bd2788 100644 --- a/cabal.project +++ b/cabal.project @@ -187,11 +187,7 @@ source-repository-package location: https://github.com/input-output-hk/hedgehog-extras tag: 8bcd3c9dc22cc44f9fcfe161f4638a384fc7a187 --- The following dependencies are not mirrored in the --- stack.yaml file, but they are needed regardless by cabal. source-repository-package type: git location: https://github.com/input-output-hk/goblins tag: cde90a2b27f79187ca8310b6549331e59595e7ba - - diff --git a/plutus-core/plutus-ir/src/PlutusIR/Core/Instance/Scoping.hs b/plutus-core/plutus-ir/src/PlutusIR/Core/Instance/Scoping.hs index e95bb5cda4c..3f6cb42d38d 100644 --- a/plutus-core/plutus-ir/src/PlutusIR/Core/Instance/Scoping.hs +++ b/plutus-core/plutus-ir/src/PlutusIR/Core/Instance/Scoping.hs @@ -43,10 +43,10 @@ instance tyname ~ TyName => Reference TyName (Datatype tyname name uni fun) wher Datatype dataAnn dataDecl params matchName $ map goConstr constrs where tyVar = TyVar (reg tyname) tyname - goConstr (VarDecl ann constrName constrTy) = VarDecl ann constrName $ goTyFun constrTy + goConstr (VarDecl ann constrName constrTy) = VarDecl ann constrName $ goSpine constrTy - goTyFun (TyFun ann dom cod) = TyFun ann (referenceVia reg tyname dom) $ goTyFun cod - goTyFun ty = TyFun NotAName tyVar $ goTyApp ty + goSpine (TyFun ann dom cod) = TyFun ann (referenceVia reg tyname dom) $ goSpine cod + goSpine ty = TyFun NotAName tyVar $ goTyApp ty goTyApp (TyApp ann fun arg) = TyApp ann (goTyApp fun) $ referenceVia reg tyname arg goTyApp ty = TyApp NotAName ty tyVar @@ -100,13 +100,13 @@ establishScopingConstrTy -> [TyVarDecl TyName NameAnn] -> Type TyName uni ann -> m (Type TyName uni NameAnn) -establishScopingConstrTy regSelf dataName params = goTyFun where +establishScopingConstrTy regSelf dataName params = goSpine where toDataAppliedToParams reg = mkIterTyApp NotAName (TyVar (reg dataName) dataName) $ map (\(TyVarDecl _ name _) -> TyVar (registerBound name) name) params - goTyFun (TyFun _ dom cod) = TyFun NotAName <$> establishScoping dom <*> goTyFun cod - goTyFun ty = TyFun NotAName (toDataAppliedToParams regSelf) <$> goTyApp ty + goSpine (TyFun _ dom cod) = TyFun NotAName <$> establishScoping dom <*> goSpine cod + goSpine ty = TyFun NotAName (toDataAppliedToParams regSelf) <$> goTyApp ty goTyApp (TyApp _ fun arg) = TyApp NotAName <$> goTyApp fun <*> establishScoping arg -- TODO: mention the weird thing that this does. diff --git a/plutus-core/plutus-ir/src/PlutusIR/Transform/Rename.hs b/plutus-core/plutus-ir/src/PlutusIR/Transform/Rename.hs index 58d7cc4c7f9..d52db054984 100644 --- a/plutus-core/plutus-ir/src/PlutusIR/Transform/Rename.hs +++ b/plutus-core/plutus-ir/src/PlutusIR/Transform/Rename.hs @@ -18,17 +18,12 @@ import PlutusPrelude import PlutusIR import PlutusIR.Mark -import qualified PlutusCore as PLC -import qualified PlutusCore.Name as PLC -import qualified PlutusCore.Rename.Internal as PLC +import qualified PlutusCore as PLC +import qualified PlutusCore.Name as PLC +import qualified PlutusCore.Rename.Internal as PLC import Control.Monad.Reader -import Control.Monad.Trans.Cont (ContT (..)) - -import Control.Monad.Except -import Data.Set as Set -import qualified PlutusCore.Quote as PLC -import PlutusCore.StdLib.Data.List +import Control.Monad.Trans.Cont (ContT (..)) {- Note [Renaming of mutually recursive bindings] The 'RenameM' monad is a newtype wrapper around @ReaderT renaming Quote@, so in order to bring @@ -123,6 +118,8 @@ captureContext k = do -- Nil :: List_2 a_1 -- Cons :: a_1 -> List_2 a_1 -> List_2 a_1 +-- TODO: handle 'TyForall' as well! + renameConstrTypeM :: (PLC.HasRenaming ren PLC.TypeUnique, PLC.HasUniques (Type tyname uni ann), PLC.MonadQuote m) => Restorer ren m -> Type tyname uni ann -> PLC.RenameT ren m (Type tyname uni ann) diff --git a/stack.yaml b/stack.yaml index 9074b9437c1..326507d540f 100644 --- a/stack.yaml +++ b/stack.yaml @@ -72,6 +72,9 @@ extra-deps: - beam-core-0.9.0.0@sha256:e5b1cb4d5b8a8a166f3373e8718672a3884feb9a5a133404b047b0af76538023,5282 - beam-migrate-0.5.0.0@sha256:d3f7e333ec9e96122ccec6be0d38a88f766dfc248323be73fd0b3cee245ea421,4923 - beam-sqlite-0.5.0.0@sha256:d785bf40101235a72b80652ce27be9c8048de5f7c171ccb23e1e62b8f1ce6e7c,3496 +- Unique-0.4.7.8 +- moo-1.2 +- gray-code-0.3.1 # cabal.project is the source of truth for these pins, they are explained there # and need to be kept in sync. @@ -84,8 +87,9 @@ extra-deps: - git: https://github.com/input-output-hk/cardano-crypto.git commit: ce8f1934e4b6252084710975bd9bbc0a4648ece4 - git: https://github.com/input-output-hk/ouroboros-network - commit: e50613562d6d4a0f933741fcf590b0f69a1eda67 + commit: e338f2cf8e1078fbda9555dd2b169c6737ef6774 subdirs: + - monoidal-synchronisation - typed-protocols - typed-protocols-examples - ouroboros-network @@ -96,7 +100,7 @@ extra-deps: - ouroboros-consensus-cardano - ouroboros-consensus-shelley - io-sim - - io-sim-classes + - io-classes - network-mux - git: https://github.com/input-output-hk/cardano-prelude commit: fd773f7a58412131512b9f694ab95653ac430852 @@ -114,7 +118,7 @@ extra-deps: - cardano-crypto-praos - strict-containers - git: https://github.com/input-output-hk/cardano-ledger-specs - commit: a3ef848542961079b7cd53d599e5385198a3035c + commit: b8f1ebb46a91f1c634e616feb89ae34de5937e17 subdirs: - byron/chain/executable-spec - byron/crypto @@ -138,13 +142,15 @@ extra-deps: - tracer-transformers - plugins/backend-ekg - git: https://github.com/input-output-hk/cardano-node.git - commit: b3cabae6b3bf30a0b1b4e78bc4b67282dabad0a6 + commit: f3ef4ed72894499160f2330b91572a159005c148 subdirs: - cardano-api - git: https://github.com/input-output-hk/Win32-network commit: 94153b676617f8f33abe8d8182c37377d2784bd1 - git: https://github.com/input-output-hk/hedgehog-extras commit: 8bcd3c9dc22cc44f9fcfe161f4638a384fc7a187 +- git: https://github.com/input-output-hk/goblins + commit: cde90a2b27f79187ca8310b6549331e59595e7ba allow-newer: true