Exemple #1
0
        public Ite <A> Else(Ite <A> ite)
        {
            switch (TheTag)
            {
            case Tag.ProduceThen:
                return(this);

            case Tag.ProduceElse:
                return(ite);

            default:
                throw new CaseException(TheTag, typeof(Tag));
            }
        }
Exemple #2
0
 public static Ite <C> Is <A, B, C>(this A a, Func <B, C> f)
     where B : A
 {
     return(a is B?Ite.ProduceThen(f((B)a)) : Ite.ProduceElse <C>());
 }