Closed ORESoftware closed 5 years ago
It would probably be most appropriate to call it a structural type system but I'd caution that without a notion of subtyping (as yet), that might not have a ton of meaning for lots of people 😄 As mentioned in other places I've been considering 1ML for a sort of structural approach to subtyping as well.
What do you mean by "subtyping"?
In something like Java:
interface A {
public int a(int someInput);
}
// B subtypes A using names, "nominal subtyping":
class B implements A {
public int a(int someInput) { ... }
}
Whereas, in my limited understanding of 1ML, we might be able to do this in Alpaca at some point:
type a = {
val a: fn int -> int
}
// Looks nominal, is actually structural, totally acceptable:
let b1 = {
let a someInput = ...
} : a
// Looks properly structural:
let b2 = {
let a someInput = ...
} : {
val a: fn int -> int
}
Sorry if I missed this in the readme - but if it's not there it should be added - does Alpaca use a nominal type system or structural?