Diffstat (limited to 'src/protocol.rs')
-rw-r--r--src/protocol.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/protocol.rs b/src/protocol.rs
index fccb8ed..c4a7f7a 100644
--- a/src/protocol.rs
+++ b/src/protocol.rs
@@ -159,6 +159,18 @@ impl<'ctx, C, B> Effect<'ctx, C, B> for SyncEffect {
type WalkerHkt = AnyTraitSendObjHkt<'ctx>;
}
+macro_rules! hkt {
+ (for<$lt:lifetime bound by $bound:lifetime> $name:ident$([$($generic:tt)*])? = $($type:tt)*) => {
+ pub struct $name<$bound $(, $($generic)*)?>(core::marker::PhantomData<fn() -> (&$bound () $(, $($generic)*)?)>);
+
+ impl<$lt, $bound $(, $($generic)*)?> crate::protocol::ForLt<$lt, $bound, Bound<$lt, $bound>> for $name<$bound $(, $($generic)*)?> {
+ type T = $($type)*;
+ }
+ }
+}
+
+hkt!(for<'a bound by 'ctx> Demo = &'a &'ctx ());
+
#[cfg(feature = "alloc")]
pub struct AsyncControlFlowHkt<'ctx, C, B>(PhantomData<fn() -> (&'ctx (), C, B)>);