| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
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
- type ConstantPoolEff (r :: [Effect]) = (State ConstantPoolState :> r, Error CodeConverterError :> r)
- type ConstantPoolEffs (r :: [(Type -> Type) -> Type -> Type]) = State ConstantPoolState ': (Error CodeConverterError ': r)
- data ConstantPoolState = ConstantPoolState {}
- runConstantPool :: forall (r :: [(Type -> Type) -> Type -> Type]) a. Eff (ConstantPoolEffs r) a -> Eff (Error CodeConverterError ': r) (a, ConstantPoolState)
- runConstantPoolWith :: forall (r :: [(Type -> Type) -> Type -> Type]) a. ConstantPoolState -> Eff (ConstantPoolEffs r) a -> Eff (Error CodeConverterError ': r) (a, ConstantPoolState)
- runConstantPoolWithPure :: forall (r :: [(Type -> Type) -> Type -> Type]) a. ConstantPoolState -> Eff (ConstantPoolEffs r) a -> Eff r (Either CodeConverterError (a, ConstantPoolState))
- findIndexOf :: forall (r :: [Effect]). (HasCallStack, ConstantPoolEff r) => ConstantPoolEntry -> Eff r U2
Documentation
type ConstantPoolEff (r :: [Effect]) = (State ConstantPoolState :> r, Error CodeConverterError :> r) Source #
A simple state monad for accumulating a ConstantPoolState
type ConstantPoolEffs (r :: [(Type -> Type) -> Type -> Type]) = State ConstantPoolState ': (Error CodeConverterError ': r) Source #
data ConstantPoolState Source #
Accumulated state of the constant pool.
Constructors
| ConstantPoolState | |
Fields
| |
Instances
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.
runConstantPoolWith :: forall (r :: [(Type -> Type) -> Type -> Type]) a. ConstantPoolState -> Eff (ConstantPoolEffs r) a -> Eff (Error CodeConverterError ': r) (a, ConstantPoolState) Source #
runConstantPoolWithPure :: forall (r :: [(Type -> Type) -> Type -> Type]) a. ConstantPoolState -> Eff (ConstantPoolEffs r) a -> Eff r (Either CodeConverterError (a, ConstantPoolState)) Source #
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.