Let you create any joinable type easily.
This is the api used for Dict.OneToOne and Dict.ManyToOne implementations.
A good other container implementation would be a database table with a forward key in addition to the primary key.
To make your container "joinable", you just need to provide a way to convert it into a Dict.
Then add a from, innerJoin and (optionally) outerLeftJoin method like this:
from =
Dict.Joinable.from convertMyContainerToDict
innerJoin =
Dict.Joinable.innerJoin convertMyContainerToDict
outerLeftJoin =
Dict.Joinable.outerLeftJoin convertMyContainerToDict
convertMyContainerToDict : MyContainer a -> Dict comparable a
convertMyContainerToDict =
...Equivalent to SQL INNER JOIN
Equivalent to SQL LEFT OUTER JOIN
Equivalent to SQL
FROM