h2jvm
Safe HaskellNone
LanguageGHC2021

H2JVM.Internal.Convert.ConstantPool

Description

Conversion of the high level constant pool types to the low level representation. This uses the IndexedMap type to keep the constant pool free from duplication.

Synopsis

Documentation

type ConstantPoolEff (r :: [Effect]) = (State ConstantPoolState :> r, Error CodeConverterError :> r) Source #

A simple state monad for accumulating a ConstantPoolState

data ConstantPoolState Source #

Accumulated state of the constant pool.

Constructors

ConstantPoolState 

Fields

Instances

Instances details
Monoid ConstantPoolState Source # 
Instance details

Defined in H2JVM.Internal.Convert.ConstantPool

Semigroup ConstantPoolState Source # 
Instance details

Defined in H2JVM.Internal.Convert.ConstantPool

Show ConstantPoolState Source # 
Instance details

Defined in H2JVM.Internal.Convert.ConstantPool

Eq ConstantPoolState Source # 
Instance details

Defined in H2JVM.Internal.Convert.ConstantPool

Ord ConstantPoolState Source # 
Instance details

Defined in H2JVM.Internal.Convert.ConstantPool

runConstantPool :: forall (r :: [(Type -> Type) -> Type -> Type]) a. Eff (ConstantPoolEffs r) a -> Eff (Error CodeConverterError ': r) (a, ConstantPoolState) Source #

Run a ConstantPool effect with an empty initial state.

findIndexOf :: forall (r :: [Effect]). (HasCallStack, ConstantPoolEff r) => ConstantPoolEntry -> Eff r U2 Source #

Find the index of a constant pool entry, inserting it in the first free location if it doesn't exist.