Let you create any joinable type easily.
This is the api used by 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) leftOuterJoin method like this:
import Dict.Joinable
from =
Dict.Joinable.from convertMyContainerToDict
innerJoin =
Dict.Joinable.innerJoin convertMyContainerToDict
leftOuterJoin =
Dict.Joinable.leftOuterJoin convertMyContainerToDict
convertMyContainerToDict : MyContainer a -> Dict comparable a
convertMyContainerToDict =
...Equivalent to SQL INNER JOIN
Equivalent to SQL LEFT OUTER JOIN
Equivalent to SQL
FROM