package scotch.data.bigint; import static java.util.Collections.emptyList; import static scotch.runtime.RuntimeSupport.applicable; import static scotch.runtime.RuntimeSupport.callable; import static scotch.symbol.type.TypeDescriptors.fn; import static scotch.symbol.type.TypeDescriptors.sum; import java.math.BigInteger; import java.util.List; import scotch.runtime.Applicable; import scotch.symbol.DataType; import scotch.symbol.TypeParameters; import scotch.symbol.Value; import scotch.symbol.ValueType; import scotch.symbol.type.TypeDescriptor; @SuppressWarnings("unused") @DataType(memberName = "BigInt") public class BigInt { public static TypeDescriptor TYPE = sum("scotch.data.bigint.BigInt"); @TypeParameters public static List<TypeDescriptor> parameters() { return emptyList(); } @Value(memberName = "bigIntDiv") public static Applicable<BigInteger, Applicable<BigInteger, BigInteger>> intDiv() { return applicable(left -> applicable(right -> callable(() -> left.call().divide(right.call())))); } @ValueType(forMember = "bigIntDiv") public static TypeDescriptor intDiv$type() { return fn(TYPE, fn(TYPE, TYPE)); } @Value(memberName = "bigIntMod") public static Applicable<BigInteger, Applicable<BigInteger, BigInteger>> intMod() { return applicable(left -> applicable(right -> callable(() -> left.call().mod(right.call())))); } @ValueType(forMember = "bigIntMod") public static TypeDescriptor intMod$type() { return fn(TYPE, fn(TYPE, TYPE)); } }