Ejemplo n.º 1
0
        private static void TryCoyonedaList()
        {
            Console.WriteLine(" -- try CoYoneda<List> --");
            var sample
                = Coyoneda <int, List <Object> > .liftCoyoneda(new List <Object> {
                100, 200, 300
            });

            var result = (Coyoneda <string, List <Object> >)DoFmap(sample);

            foreach (string item in MapCoyonedaList <string>(result))
            {
                Console.WriteLine(item);
            }
        }
Ejemplo n.º 2
0
        private static void TryCoyonedaOption()
        {
            Console.WriteLine(" -- try CoYoneda<Option> --");
            var sample1
                = Coyoneda <int, Option <Object> > .liftCoyoneda(new Some <Object>(100));

            var sample2
                = Coyoneda <int, Option <Object> > .liftCoyoneda(new None <Object>());

            var result1 = (Coyoneda <string, Option <Object> >)DoFmap(sample1);
            var result2 = (Coyoneda <string, Option <Object> >)DoFmap(sample2);

            Console.WriteLine(MapCoyonedaOption <string>(result1));
            Console.WriteLine(MapCoyonedaOption <string>(result2));
        }