
org.smallibs.control.Free Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hpas Show documentation
Show all versions of hpas Show documentation
Functional ADT And Asynchronous library in Java
/*
* 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