So, Elm lets you do a forall over the rest of a record.
{a | x : Int} -> Int says this function accepts any record that has an x
Int field.
The problem is when you want a list of them. List {a | x : Int} only lets
you make a list of records with the same type filling in for a.
With existential types you can say that you want a list of records with an
x Int field, but you don't care what's in the rest of the record. As long
as for each record in the list there exists some a that the record is equal
to { a | x : Int} we're fine. Each element of the list can have a different
a.
On Feb 10, 2017 9:16 AM, "'Rupert Smith' via Elm Discuss" <
[email protected]> wrote:
On Friday, February 10, 2017 at 3:10:57 PM UTC, Joey Eremondi wrote:
>
> It's usually called row polymorphism, and isn't really subtyping, although
> you get something like subtyping if you combine it with existential types,
> which would lose decidability.
>
Yes, Ob<: had existential types. It was long enough ago that I have no idea
what that means, but I do remember it had universal and existential
qualifiers.
--
You received this message because you are subscribed to the Google Groups
"Elm Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to [email protected].
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Elm
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.