示例#1
0
        //ICategory<C, B> ICategory<A, B>.Left<C>(ICategory<C, A> cat)
        //{
        //    return Left((SimpleFunc<C, A>)cat);
        //}

        public SimpleFunc <A, C> Right <C>(SimpleFunc <B, C> s)
        {
            return(new SimpleFunc <A, C>(a => s.RunF(RunF(a))));
        }
示例#2
0
        //ICategory<C, B> ICategory<A, B>.Dot<C>(ICategory<C, A> cat)
        //{
        //    return Dot((SimpleFunc<C, A>)cat);
        //}

        SimpleFunc <C, B> Left <C>(SimpleFunc <C, A> s)
        {
            return(new SimpleFunc <C, B>(c => RunF(s.RunF(c))));
        }
示例#3
0
        //IArrow<Tuple<A, C>, Tuple<B, C>> IArrow<A, B>.First<C>(IArrow<A, B> arrow)
        //{
        //    return First<C>((SimpleFunc<A, B>)arrow);
        //}

        public static SimpleFunc <Tuple <C, A>, Tuple <C, B> > Second <C>(SimpleFunc <A, B> s)
        {
            return(new SimpleFunc <Tuple <C, A>, Tuple <C, B> >(t => new Tuple <C, B>(t.Item1, s.RunF(t.Item2))));
        }
示例#4
0
        //ICategory<A, B> ICategory<A, B>.Id()
        //{
        //    return Id();
        //}

        public static Func <SimpleFunc <C, A>, SimpleFunc <C, B> > Dot <C>(SimpleFunc <A, B> cat)
        {
            return(s => new SimpleFunc <C, B>(c => cat.RunF(s.RunF(c))));
        }
示例#5
0
        //IArrow<A, B> IArrow<A, B>.Arr(Func<A, B> func) { return Arr(func); }

        public static SimpleFunc <Tuple <A, C>, Tuple <B, C> > First <C>(SimpleFunc <A, B> s)
        {
            return(new SimpleFunc <Tuple <A, C>, Tuple <B, C> >(t => new Tuple <B, C>(s.RunF(t.Item1), t.Item2)));
        }