package scotch.data.eq;
import static java.util.Arrays.asList;
import static scotch.runtime.RuntimeSupport.callable;
import java.util.List;
import scotch.runtime.Callable;
import scotch.symbol.InstanceGetter;
import scotch.symbol.TypeInstance;
import scotch.symbol.TypeParameters;
import scotch.symbol.type.TypeDescriptor;
import scotch.symbol.type.TypeDescriptors;
@SuppressWarnings("unused")
@TypeInstance(typeClass = "scotch.data.eq.Eq")
public class EqBool implements Eq<Boolean> {
private static final Callable<EqBool> INSTANCE = callable(EqBool::new);
@InstanceGetter
public static Callable<EqBool> instance() {
return INSTANCE;
}
@TypeParameters
public static List<TypeDescriptor> parameters() {
return asList(TypeDescriptors.sum("scotch.data.int.Bool"));
}
private EqBool() {
// intentionally empty
}
@Override
public Callable<Boolean> eq(Callable<Boolean> left, Callable<Boolean> right) {
return callable(() -> left.call().equals(right.call()));
}
}