use lubeck::common::reader::Reader; use lubeck::common::transformer::optiont::generic_try::OptionT; use lubeck::common::writer::Writer; use lubeck::prelude::Applicative; use lubeck::prelude::Functor; // All the Monads Transformed fn main() { // reader type ReaderOptT<'a, R, A> = OptionT<'a, Reader<'a, R, Option>, A>; type ReaderOptI32<'a> = ReaderOptT<'a, i32, i32>; let x = ReaderOptI32::pure(0); // not quiet what I was looking for ... let _ = x.fmap(|x| x.map(|x| x + 1)); // writer type WriterOptT<'a, W, A> = OptionT<'a, Writer<'a, W, Option>, A>; type WriterOptI32<'a> = WriterOptT<'a, String, i32>; let x = WriterOptI32::pure(0); let _ = x.fmap(|x| x.map(|x| x + 1)); // stacked option type OptOptT<'a, A> = OptionT<'a, Option>, A>; type OptOptI32<'a> = OptOptT<'a, i32>; let x = OptOptI32::pure(0); let _ = x.fmap(|x| x.map(|x| x + 1)); // stacked transformers !!! This doesn't work yet because of the Gentype issue //type OptReaderOptT<'a, R, A> = OptionT<'a, ReaderOptT<'a, R, A>, A>; //type OptReaderOptI32<'a> = OptReaderOptT<'a, i32, i32>; //let x = OptReaderOptI32::pure(0); }