Пример #1
0
        public static UpsideDown <TResult> Map1 <TResult>(
            UpsideDown <T> upsideDownValue,
            Func <T, TResult> normalFunction)
        {
            var normalValue  = upsideDownValue.PortalFromUpsideDown();
            var normalResult = normalFunction(normalValue);

            return(normalResult.PortalToUpsideDown());
        }
Пример #2
0
        public static UpsideDown <TResult> Apply <TResult>(
            UpsideDown <T> upsideDownValue,
            UpsideDown <Func <T, TResult> > upsideDownFunction)
        {
            var normalValue    = upsideDownValue.PortalFromUpsideDown();
            var normalFunction = upsideDownFunction.PortalFromUpsideDown();
            var normalResult   = normalFunction(normalValue);

            return(normalResult.PortalToUpsideDown());
        }