All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.smallibs.control.Free Maven / Gradle / Ivy

There is a newer version: 0.11.0
Show newest version
/*
 * HPAS
 * https://github.com/d-plaindoux/hpas
 *
 * Copyright (c) 2016-2017 Didier Plaindoux
 * Licensed under the LGPL2 license.
 */

package org.smallibs.control;

import org.smallibs.type.HK;

/**
 * Free *
 *
 * @param 
 * @param 
 */
public interface Free {

    static  Free pure(A a) {
        return new Pure<>(a);
    }

    static , Self>> Free impure(HK, Self> s) {
        return new Impure<>(s);
    }

    class Pure implements Free {
        private final A a;

        private Pure(A a) {
            this.a = a;
        }
    }

    class Impure, Self>> implements Free {
        private final HK, Self> s;

        private Impure(HK, Self> s) {
            this.s = s;
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy