Skip to content

Commit

Permalink
Cleanup code as per PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
0xd34df00d committed Dec 13, 2023
1 parent ff45011 commit 2dec8d0
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 25 deletions.
11 changes: 0 additions & 11 deletions pact-core/Pact/Core/Capabilities.hs
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,6 @@ data DefCapMeta name
| Unmanaged
deriving (Show, Functor, Foldable, Traversable)

-- data DefManagedMeta name
-- = DefManagedMeta Int (FQNameRef name)
-- | AutoManagedMeta
-- deriving (Show)

-- data DefCapMeta name
-- = DefEvent
-- | DefManaged (DefManagedMeta name)
-- | Unmanaged
-- deriving (Show)

dcMetaFqName :: Traversal' (DefCapMeta (FQNameRef Name)) FullyQualifiedName
dcMetaFqName f = \case
DefManaged (DefManagedMeta i (FQName fqn)) ->
Expand Down
2 changes: 1 addition & 1 deletion pact-core/Pact/Core/IR/Desugar.hs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ module Pact.Core.IR.Desugar
) where

import Control.Applicative((<|>))
import Control.Monad ( when, forM, (>=>), unless, guard)
import Control.Monad
import Control.Monad.Reader
import Control.Monad.State.Strict ( StateT(..), MonadState )
import Control.Monad.Trans.Maybe(MaybeT(..), runMaybeT, hoistMaybe)
Expand Down
13 changes: 0 additions & 13 deletions pact-core/Pact/Core/IR/Eval/Runtime/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -286,17 +286,9 @@ data EvalResult b i m
deriving Show


-- data EvalTEnv b i
-- = EvalTEnv
-- { _emRuntimeEnv :: EvalEnv b i
-- , _emGas :: IORef Gas
-- , _emGasLog :: IORef (Maybe [(Text, Gas)])
-- }

-- Todo: are we going to inject state as the reader monad here?
newtype EvalM b i a =
EvalT (ReaderT (EvalEnv b i) (ExceptT (PactError i) (StateT (EvalState b i) IO)) a)
-- EvalT (ReaderT (EvalEnv b i) (StateT (EvalState b i) (ExceptT (PactError i) IO)) a)
deriving
( Functor, Applicative, Monad
, MonadIO
Expand Down Expand Up @@ -451,16 +443,11 @@ instance (Show i, Show b, Pretty b) => Pretty (CEKValue b i m) where
P.angles "closure#"

makeLenses ''CEKEnv
-- makeLenses ''EvalEnv

instance MonadGas (EvalM b i) where
logGas _msg _g = pure ()
-- r <- EvalT $ view emGasLog
-- liftIO $ modifyIORef' r (fmap ((msg, g):))

chargeGas _g = pure ()
-- r <- EvalT $ view emGas
-- liftIO (modifyIORef' r (<> g))

instance MonadEvalEnv b i (EvalM b i) where
readEnv = EvalT ask
Expand Down

0 comments on commit 2dec8d0

Please sign in to comment.