What is Nostr?
[yaseenist] Julia :verified_trans: /
npub1hhu…h49a
2023-06-13 21:20:24

[yaseenist] Julia :verified_trans: on Nostr: mmmmmmmmmm use higher_kinded_types::HKT; trait DynParser { type Output: HKT; fn ...

mmmmmmmmmm

use higher_kinded_types::HKT;

trait DynParser {
type Output: HKT;

fn dyn_parse<'a>(
&self,
input: &'a str,
chars: CharIndices<'a>,
state: &mut ParserState,
) -> Result<'a, <Self::Output as HKT>::__<'a>>;
}

impl<T> DynParser for T
where
T: Parser,
{
type Output = HKT!(<'a> = T::Output<'a>);

fn dyn_parse<'a>(
&self,
input: &'a str,
chars: CharIndices<'a>,
state: &mut ParserState,
) -> Result<'a, <Self::Output as HKT>::__<'a>> {
self.parse(input, chars, state)
}
}
Author Public Key
npub1hhuwd2wgtxcrkgsczvtdpafw3p4xtuf54d2s937hacn9n2vggzdqdph49a