{-# LANGUAGE AllowAmbiguousTypes,
MagicHash,
TypeApplications,
TypeFamilies #-}
module Parsley.Internal.Backend.Machine.Types.Statics (
StaHandler#, StaHandler, AugmentedStaHandler, StaHandlerCase,
fromStaHandler#, fromDynHandler, staHandler#,
augmentHandler, augmentHandlerSta, augmentHandlerDyn, augmentHandlerFull,
staHandlerEval, staHandlerCharacteristicSta, staHandlerCharacteristicDyn,
StaCont#, StaCont(..),
mkStaCont, mkStaContDyn,
staCont#,
QSubroutine(..), StaSubroutine, StaSubroutine#, StaFunc,
qSubroutine, mkStaSubroutine, mkStaSubroutineMeta,
staSubroutine#, meta,
) where
import Control.Monad.ST (ST)
import Data.STRef (STRef)
import Data.Kind (Type)
import Data.Maybe (fromMaybe)
import Parsley.Internal.Backend.Machine.InputRep (Rep)
import Parsley.Internal.Backend.Machine.LetBindings (Regs(..), Metadata, newMeta, InputCharacteristic(..))
import Parsley.Internal.Backend.Machine.Types.Dynamics (DynCont, DynHandler, DynFunc)
import Parsley.Internal.Backend.Machine.Types.Offset (Offset(offset), same)
import Parsley.Internal.Common.Utils (Code)
type StaHandler# s o a = Code (Rep o) -> Code (ST s (Maybe a))
mkStaHandler# :: forall o s a. DynHandler s o a -> StaHandler# s o a
mkStaHandler# :: DynHandler s o a -> StaHandler# s o a
mkStaHandler# DynHandler s o a
dh Code (Rep o)
qo# = [||$$dh $$(qo#)||]
data StaHandler s o a = StaHandler {
StaHandler s o a -> StaHandler# s o a
staHandler# :: StaHandler# s o a,
StaHandler s o a -> Maybe (DynHandler s o a)
dynOrigin :: Maybe (DynHandler s o a)
}
dynHandler :: (StaHandler# s o a -> DynHandler s o a) -> StaHandler s o a -> DynHandler s o a
dynHandler :: (StaHandler# s o a -> DynHandler s o a)
-> StaHandler s o a -> DynHandler s o a
dynHandler StaHandler# s o a -> DynHandler s o a
conv = DynHandler s o a -> Maybe (DynHandler s o a) -> DynHandler s o a
forall a. a -> Maybe a -> a
fromMaybe (DynHandler s o a -> Maybe (DynHandler s o a) -> DynHandler s o a)
-> (StaHandler s o a -> DynHandler s o a)
-> StaHandler s o a
-> Maybe (DynHandler s o a)
-> DynHandler s o a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. StaHandler# s o a -> DynHandler s o a
conv (StaHandler# s o a -> DynHandler s o a)
-> (StaHandler s o a -> StaHandler# s o a)
-> StaHandler s o a
-> DynHandler s o a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. StaHandler s o a -> StaHandler# s o a
forall s o a. StaHandler s o a -> StaHandler# s o a
staHandler# (StaHandler s o a -> Maybe (DynHandler s o a) -> DynHandler s o a)
-> (StaHandler s o a -> Maybe (DynHandler s o a))
-> StaHandler s o a
-> DynHandler s o a
forall (f :: Type -> Type) a b.
Applicative f =>
f (a -> b) -> f a -> f b
<*> StaHandler s o a -> Maybe (DynHandler s o a)
forall s o a. StaHandler s o a -> Maybe (DynHandler s o a)
dynOrigin
fromStaHandler# :: StaHandler# s o a -> StaHandler s o a
fromStaHandler# :: StaHandler# s o a -> StaHandler s o a
fromStaHandler# StaHandler# s o a
h = StaHandler# s o a -> Maybe (DynHandler s o a) -> StaHandler s o a
forall s o a.
StaHandler# s o a -> Maybe (DynHandler s o a) -> StaHandler s o a
StaHandler StaHandler# s o a
h Maybe (DynHandler s o a)
forall a. Maybe a
Nothing
fromDynHandler :: forall s o a. DynHandler s o a -> StaHandler s o a
fromDynHandler :: DynHandler s o a -> StaHandler s o a
fromDynHandler DynHandler s o a
h = StaHandler# s o a -> Maybe (DynHandler s o a) -> StaHandler s o a
forall s o a.
StaHandler# s o a -> Maybe (DynHandler s o a) -> StaHandler s o a
StaHandler (DynHandler s o a -> StaHandler# s o a
forall o s a. DynHandler s o a -> StaHandler# s o a
mkStaHandler# @o DynHandler s o a
h) (DynHandler s o a -> Maybe (DynHandler s o a)
forall a. a -> Maybe a
Just DynHandler s o a
h)
data AugmentedStaHandler s o a =
AugmentedStaHandler
(Maybe (Offset o))
(StaHandlerCase s o a)
augmentHandlerSta :: Maybe (Offset o) -> StaHandler# s o a -> AugmentedStaHandler s o a
augmentHandlerSta :: Maybe (Offset o) -> StaHandler# s o a -> AugmentedStaHandler s o a
augmentHandlerSta Maybe (Offset o)
o = Maybe (Offset o) -> StaHandler s o a -> AugmentedStaHandler s o a
forall o s a.
Maybe (Offset o) -> StaHandler s o a -> AugmentedStaHandler s o a
augmentHandler Maybe (Offset o)
o (StaHandler s o a -> AugmentedStaHandler s o a)
-> (StaHandler# s o a -> StaHandler s o a)
-> StaHandler# s o a
-> AugmentedStaHandler s o a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. StaHandler# s o a -> StaHandler s o a
forall s o a. StaHandler# s o a -> StaHandler s o a
fromStaHandler#
augmentHandlerDyn :: forall s o a. Maybe (Offset o) -> DynHandler s o a -> AugmentedStaHandler s o a
augmentHandlerDyn :: Maybe (Offset o) -> DynHandler s o a -> AugmentedStaHandler s o a
augmentHandlerDyn Maybe (Offset o)
c = Maybe (Offset o) -> StaHandler s o a -> AugmentedStaHandler s o a
forall o s a.
Maybe (Offset o) -> StaHandler s o a -> AugmentedStaHandler s o a
augmentHandler Maybe (Offset o)
c (StaHandler s o a -> AugmentedStaHandler s o a)
-> (DynHandler s o a -> StaHandler s o a)
-> DynHandler s o a
-> AugmentedStaHandler s o a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. DynHandler s o a -> StaHandler s o a
forall s o a. DynHandler s o a -> StaHandler s o a
fromDynHandler
augmentHandler :: Maybe (Offset o) -> StaHandler s o a -> AugmentedStaHandler s o a
augmentHandler :: Maybe (Offset o) -> StaHandler s o a -> AugmentedStaHandler s o a
augmentHandler Maybe (Offset o)
c = Maybe (Offset o)
-> StaHandlerCase s o a -> AugmentedStaHandler s o a
forall s o a.
Maybe (Offset o)
-> StaHandlerCase s o a -> AugmentedStaHandler s o a
AugmentedStaHandler Maybe (Offset o)
c (StaHandlerCase s o a -> AugmentedStaHandler s o a)
-> (StaHandler s o a -> StaHandlerCase s o a)
-> StaHandler s o a
-> AugmentedStaHandler s o a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. StaHandler s o a -> StaHandlerCase s o a
forall s o a. StaHandler s o a -> StaHandlerCase s o a
mkUnknown
augmentHandlerFull :: Offset o
-> StaHandler s o a
-> Code (ST s (Maybe a))
-> StaHandler s o a
-> AugmentedStaHandler s o a
augmentHandlerFull :: Offset o
-> StaHandler s o a
-> Code (ST s (Maybe a))
-> StaHandler s o a
-> AugmentedStaHandler s o a
augmentHandlerFull Offset o
c StaHandler s o a
handler Code (ST s (Maybe a))
yes StaHandler s o a
no = Maybe (Offset o)
-> StaHandlerCase s o a -> AugmentedStaHandler s o a
forall s o a.
Maybe (Offset o)
-> StaHandlerCase s o a -> AugmentedStaHandler s o a
AugmentedStaHandler (Offset o -> Maybe (Offset o)
forall a. a -> Maybe a
Just Offset o
c)
(StaHandler s o a
-> Code (ST s (Maybe a))
-> StaHandler s o a
-> StaHandlerCase s o a
forall s o a.
StaHandler s o a
-> Code (ST s (Maybe a))
-> StaHandler s o a
-> StaHandlerCase s o a
mkFull StaHandler s o a
handler
Code (ST s (Maybe a))
yes
StaHandler s o a
no)
staHandlerEval :: AugmentedStaHandler s o a -> Offset o -> Code (ST s (Maybe a))
staHandlerEval :: AugmentedStaHandler s o a -> Offset o -> Code (ST s (Maybe a))
staHandlerEval (AugmentedStaHandler (Just Offset o
c) StaHandlerCase s o a
sh) Offset o
o
| Just Bool
True <- Offset o -> Offset o -> Maybe Bool
forall o. Offset o -> Offset o -> Maybe Bool
same Offset o
c Offset o
o = (Code (Rep o) -> Code (ST s (Maybe a)))
-> (Code (ST s (Maybe a)) -> Code (Rep o) -> Code (ST s (Maybe a)))
-> Maybe (Code (ST s (Maybe a)))
-> Code (Rep o)
-> Code (ST s (Maybe a))
forall b a. b -> (a -> b) -> Maybe a -> b
maybe (StaHandler s o a -> Code (Rep o) -> Code (ST s (Maybe a))
forall s o a. StaHandler s o a -> StaHandler# s o a
staHandler# (StaHandlerCase s o a -> StaHandler s o a
forall s o a. StaHandlerCase s o a -> StaHandler s o a
unknown StaHandlerCase s o a
sh)) Code (ST s (Maybe a)) -> Code (Rep o) -> Code (ST s (Maybe a))
forall a b. a -> b -> a
const (StaHandlerCase s o a -> Maybe (Code (ST s (Maybe a)))
forall s o a. StaHandlerCase s o a -> Maybe (Code (ST s (Maybe a)))
yesSame StaHandlerCase s o a
sh) (Offset o -> Code (Rep o)
forall o. Offset o -> Code (Rep o)
offset Offset o
o)
| Just Bool
False <- Offset o -> Offset o -> Maybe Bool
forall o. Offset o -> Offset o -> Maybe Bool
same Offset o
c Offset o
o = StaHandler s o a -> Code (Rep o) -> Code (ST s (Maybe a))
forall s o a. StaHandler s o a -> StaHandler# s o a
staHandler# (StaHandler s o a -> Maybe (StaHandler s o a) -> StaHandler s o a
forall a. a -> Maybe a -> a
fromMaybe (StaHandlerCase s o a -> StaHandler s o a
forall s o a. StaHandlerCase s o a -> StaHandler s o a
unknown StaHandlerCase s o a
sh) (StaHandlerCase s o a -> Maybe (StaHandler s o a)
forall s o a. StaHandlerCase s o a -> Maybe (StaHandler s o a)
notSame StaHandlerCase s o a
sh)) (Offset o -> Code (Rep o)
forall o. Offset o -> Code (Rep o)
offset Offset o
o)
staHandlerEval (AugmentedStaHandler Maybe (Offset o)
_ StaHandlerCase s o a
sh) Offset o
o = StaHandler s o a -> Code (Rep o) -> Code (ST s (Maybe a))
forall s o a. StaHandler s o a -> StaHandler# s o a
staHandler# (StaHandlerCase s o a -> StaHandler s o a
forall s o a. StaHandlerCase s o a -> StaHandler s o a
unknown StaHandlerCase s o a
sh) (Offset o -> Code (Rep o)
forall o. Offset o -> Code (Rep o)
offset Offset o
o)
staHandlerCharacteristic :: AugmentedStaHandler s o a -> (StaHandler# s o a -> DynHandler s o a) -> InputCharacteristic -> StaHandler s o a
staHandlerCharacteristic :: AugmentedStaHandler s o a
-> (StaHandler# s o a -> DynHandler s o a)
-> InputCharacteristic
-> StaHandler s o a
staHandlerCharacteristic (AugmentedStaHandler Maybe (Offset o)
_ StaHandlerCase s o a
sh) StaHandler# s o a -> DynHandler s o a
conv InputCharacteristic
NeverConsumes = StaHandler s o a
-> (Code (ST s (Maybe a)) -> StaHandler s o a)
-> Maybe (Code (ST s (Maybe a)))
-> StaHandler s o a
forall b a. b -> (a -> b) -> Maybe a -> b
maybe (StaHandlerCase s o a -> StaHandler s o a
forall s o a. StaHandlerCase s o a -> StaHandler s o a
unknown StaHandlerCase s o a
sh) (StaHandler# s o a -> Maybe (DynHandler s o a) -> StaHandler s o a
forall s o a.
StaHandler# s o a -> Maybe (DynHandler s o a) -> StaHandler s o a
StaHandler (StaHandler# s o a -> Maybe (DynHandler s o a) -> StaHandler s o a)
-> (Code (ST s (Maybe a)) -> StaHandler# s o a)
-> Code (ST s (Maybe a))
-> Maybe (DynHandler s o a)
-> StaHandler s o a
forall (f :: Type -> Type) a b. Functor f => (a -> b) -> f a -> f b
<$> Code (ST s (Maybe a)) -> StaHandler# s o a
forall a b. a -> b -> a
const (Code (ST s (Maybe a))
-> Maybe (DynHandler s o a) -> StaHandler s o a)
-> (Code (ST s (Maybe a)) -> Maybe (DynHandler s o a))
-> Code (ST s (Maybe a))
-> StaHandler s o a
forall (f :: Type -> Type) a b.
Applicative f =>
f (a -> b) -> f a -> f b
<*> DynHandler s o a -> Maybe (DynHandler s o a)
forall a. a -> Maybe a
Just (DynHandler s o a -> Maybe (DynHandler s o a))
-> (Code (ST s (Maybe a)) -> DynHandler s o a)
-> Code (ST s (Maybe a))
-> Maybe (DynHandler s o a)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. StaHandler# s o a -> DynHandler s o a
conv (StaHandler# s o a -> DynHandler s o a)
-> (Code (ST s (Maybe a)) -> StaHandler# s o a)
-> Code (ST s (Maybe a))
-> DynHandler s o a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Code (ST s (Maybe a)) -> StaHandler# s o a
forall a b. a -> b -> a
const) (StaHandlerCase s o a -> Maybe (Code (ST s (Maybe a)))
forall s o a. StaHandlerCase s o a -> Maybe (Code (ST s (Maybe a)))
yesSame StaHandlerCase s o a
sh)
staHandlerCharacteristic (AugmentedStaHandler Maybe (Offset o)
_ StaHandlerCase s o a
sh) StaHandler# s o a -> DynHandler s o a
_ (AlwaysConsumes Maybe Word
_) = StaHandler s o a -> Maybe (StaHandler s o a) -> StaHandler s o a
forall a. a -> Maybe a -> a
fromMaybe (StaHandlerCase s o a -> StaHandler s o a
forall s o a. StaHandlerCase s o a -> StaHandler s o a
unknown StaHandlerCase s o a
sh) (StaHandlerCase s o a -> Maybe (StaHandler s o a)
forall s o a. StaHandlerCase s o a -> Maybe (StaHandler s o a)
notSame StaHandlerCase s o a
sh)
staHandlerCharacteristic (AugmentedStaHandler Maybe (Offset o)
_ StaHandlerCase s o a
sh) StaHandler# s o a -> DynHandler s o a
_ InputCharacteristic
MayConsume = StaHandlerCase s o a -> StaHandler s o a
forall s o a. StaHandlerCase s o a -> StaHandler s o a
unknown StaHandlerCase s o a
sh
staHandlerCharacteristicSta :: AugmentedStaHandler s o a -> InputCharacteristic -> StaHandler# s o a
staHandlerCharacteristicSta :: AugmentedStaHandler s o a
-> InputCharacteristic -> StaHandler# s o a
staHandlerCharacteristicSta AugmentedStaHandler s o a
sh = StaHandler s o a -> StaHandler# s o a
forall s o a. StaHandler s o a -> StaHandler# s o a
staHandler# (StaHandler s o a -> StaHandler# s o a)
-> (InputCharacteristic -> StaHandler s o a)
-> InputCharacteristic
-> StaHandler# s o a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. AugmentedStaHandler s o a
-> (StaHandler# s o a -> DynHandler s o a)
-> InputCharacteristic
-> StaHandler s o a
forall s o a.
AugmentedStaHandler s o a
-> (StaHandler# s o a -> DynHandler s o a)
-> InputCharacteristic
-> StaHandler s o a
staHandlerCharacteristic AugmentedStaHandler s o a
sh StaHandler# s o a -> DynHandler s o a
forall a. HasCallStack => a
undefined
staHandlerCharacteristicDyn :: AugmentedStaHandler s o a -> (StaHandler# s o a -> DynHandler s o a) -> InputCharacteristic -> DynHandler s o a
staHandlerCharacteristicDyn :: AugmentedStaHandler s o a
-> (StaHandler# s o a -> DynHandler s o a)
-> InputCharacteristic
-> DynHandler s o a
staHandlerCharacteristicDyn AugmentedStaHandler s o a
sh StaHandler# s o a -> DynHandler s o a
conv = (StaHandler# s o a -> DynHandler s o a)
-> StaHandler s o a -> DynHandler s o a
forall s o a.
(StaHandler# s o a -> DynHandler s o a)
-> StaHandler s o a -> DynHandler s o a
dynHandler StaHandler# s o a -> DynHandler s o a
conv (StaHandler s o a -> DynHandler s o a)
-> (InputCharacteristic -> StaHandler s o a)
-> InputCharacteristic
-> DynHandler s o a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. AugmentedStaHandler s o a
-> (StaHandler# s o a -> DynHandler s o a)
-> InputCharacteristic
-> StaHandler s o a
forall s o a.
AugmentedStaHandler s o a
-> (StaHandler# s o a -> DynHandler s o a)
-> InputCharacteristic
-> StaHandler s o a
staHandlerCharacteristic AugmentedStaHandler s o a
sh StaHandler# s o a -> DynHandler s o a
conv
data StaHandlerCase s (o :: Type) a = StaHandlerCase {
StaHandlerCase s o a -> StaHandler s o a
unknown :: StaHandler s o a,
StaHandlerCase s o a -> Maybe (Code (ST s (Maybe a)))
yesSame :: Maybe (Code (ST s (Maybe a))),
StaHandlerCase s o a -> Maybe (StaHandler s o a)
notSame :: Maybe (StaHandler s o a)
}
mkUnknown :: StaHandler s o a -> StaHandlerCase s o a
mkUnknown :: StaHandler s o a -> StaHandlerCase s o a
mkUnknown StaHandler s o a
h = StaHandler s o a
-> Maybe (Code (ST s (Maybe a)))
-> Maybe (StaHandler s o a)
-> StaHandlerCase s o a
forall s o a.
StaHandler s o a
-> Maybe (Code (ST s (Maybe a)))
-> Maybe (StaHandler s o a)
-> StaHandlerCase s o a
StaHandlerCase StaHandler s o a
h Maybe (Code (ST s (Maybe a)))
forall a. Maybe a
Nothing Maybe (StaHandler s o a)
forall a. Maybe a
Nothing
mkFull :: StaHandler s o a -> Code (ST s (Maybe a)) -> StaHandler s o a -> StaHandlerCase s o a
mkFull :: StaHandler s o a
-> Code (ST s (Maybe a))
-> StaHandler s o a
-> StaHandlerCase s o a
mkFull StaHandler s o a
h Code (ST s (Maybe a))
yes StaHandler s o a
no = StaHandler s o a
-> Maybe (Code (ST s (Maybe a)))
-> Maybe (StaHandler s o a)
-> StaHandlerCase s o a
forall s o a.
StaHandler s o a
-> Maybe (Code (ST s (Maybe a)))
-> Maybe (StaHandler s o a)
-> StaHandlerCase s o a
StaHandlerCase StaHandler s o a
h (Code (ST s (Maybe a)) -> Maybe (Code (ST s (Maybe a)))
forall a. a -> Maybe a
Just Code (ST s (Maybe a))
yes) (StaHandler s o a -> Maybe (StaHandler s o a)
forall a. a -> Maybe a
Just StaHandler s o a
no)
type StaCont# s o a x = Code x -> Code (Rep o) -> Code (ST s (Maybe a))
data StaCont s o a x = StaCont (StaCont# s o a x) (Maybe (DynCont s o a x))
mkStaContDyn :: DynCont s o a x -> StaCont s o a x
mkStaContDyn :: DynCont s o a x -> StaCont s o a x
mkStaContDyn DynCont s o a x
dk = StaCont# s o a x -> Maybe (DynCont s o a x) -> StaCont s o a x
forall s o a x.
StaCont# s o a x -> Maybe (DynCont s o a x) -> StaCont s o a x
StaCont (\Code x
x Code (Rep o)
o# -> [|| $$dk $$x $$(o#) ||]) (DynCont s o a x -> Maybe (DynCont s o a x)
forall a. a -> Maybe a
Just DynCont s o a x
dk)
staCont# :: StaCont s o a x -> StaCont# s o a x
staCont# :: StaCont s o a x -> StaCont# s o a x
staCont# (StaCont StaCont# s o a x
sk Maybe (DynCont s o a x)
_) = StaCont# s o a x
sk
mkStaCont :: StaCont# s o a x -> StaCont s o a x
mkStaCont :: StaCont# s o a x -> StaCont s o a x
mkStaCont StaCont# s o a x
sk = StaCont# s o a x -> Maybe (DynCont s o a x) -> StaCont s o a x
forall s o a x.
StaCont# s o a x -> Maybe (DynCont s o a x) -> StaCont s o a x
StaCont StaCont# s o a x
sk Maybe (DynCont s o a x)
forall a. Maybe a
Nothing
type StaSubroutine# s o a x = DynCont s o a x -> Code (Rep o) -> DynHandler s o a -> Code (ST s (Maybe a))
data StaSubroutine s o a x = StaSubroutine {
StaSubroutine s o a x -> StaSubroutine# s o a x
staSubroutine# :: StaSubroutine# s o a x,
StaSubroutine s o a x -> Metadata
meta :: Metadata
}
mkStaSubroutine :: StaSubroutine# s o a x -> StaSubroutine s o a x
mkStaSubroutine :: StaSubroutine# s o a x -> StaSubroutine s o a x
mkStaSubroutine = Metadata -> StaSubroutine# s o a x -> StaSubroutine s o a x
forall s o a x.
Metadata -> StaSubroutine# s o a x -> StaSubroutine s o a x
mkStaSubroutineMeta Metadata
newMeta
mkStaSubroutineMeta :: Metadata -> StaSubroutine# s o a x -> StaSubroutine s o a x
mkStaSubroutineMeta :: Metadata -> StaSubroutine# s o a x -> StaSubroutine s o a x
mkStaSubroutineMeta = (StaSubroutine# s o a x -> Metadata -> StaSubroutine s o a x)
-> Metadata -> StaSubroutine# s o a x -> StaSubroutine s o a x
forall a b c. (a -> b -> c) -> b -> a -> c
flip StaSubroutine# s o a x -> Metadata -> StaSubroutine s o a x
forall s o a x.
StaSubroutine# s o a x -> Metadata -> StaSubroutine s o a x
StaSubroutine
type family StaFunc (rs :: [Type]) s o a x where
StaFunc '[] s o a x = StaSubroutine s o a x
StaFunc (r : rs) s o a x = Code (STRef s r) -> StaFunc rs s o a x
data QSubroutine s o a x = forall rs. QSubroutine (StaFunc rs s o a x) (Regs rs)
qSubroutine :: forall s o a x rs. DynFunc rs s o a x -> Regs rs -> Metadata -> QSubroutine s o a x
qSubroutine :: DynFunc rs s o a x -> Regs rs -> Metadata -> QSubroutine s o a x
qSubroutine DynFunc rs s o a x
func Regs rs
frees Metadata
meta = StaFunc rs s o a x -> Regs rs -> QSubroutine s o a x
forall s o a x (rs :: [Type]).
StaFunc rs s o a x -> Regs rs -> QSubroutine s o a x
QSubroutine (Regs rs -> DynFunc rs s o a x -> StaFunc rs s o a x
forall (rs :: [Type]).
Regs rs -> DynFunc rs s o a x -> StaFunc rs s o a x
staFunc Regs rs
frees DynFunc rs s o a x
func) Regs rs
frees
where
staFunc :: forall rs. Regs rs -> DynFunc rs s o a x -> StaFunc rs s o a x
staFunc :: Regs rs -> DynFunc rs s o a x -> StaFunc rs s o a x
staFunc Regs rs
NoRegs DynFunc rs s o a x
func = StaSubroutine# s o a x -> Metadata -> StaSubroutine s o a x
forall s o a x.
StaSubroutine# s o a x -> Metadata -> StaSubroutine s o a x
StaSubroutine (\DynCont s o a x
dk Code (Rep o)
o# DynHandler s o a
dh -> [|| $$func $$dk $$(o#) $$dh ||]) Metadata
meta
staFunc (FreeReg ΣVar r
_ Regs rs
witness) DynFunc rs s o a x
func = \Q (TExp (STRef s r))
r -> Regs rs -> DynFunc rs s o a x -> StaFunc rs s o a x
forall (rs :: [Type]).
Regs rs -> DynFunc rs s o a x -> StaFunc rs s o a x
staFunc Regs rs
witness [|| $$func $$r ||]