Closed neko-kai closed 10 years ago
It seems like view (from table)
and toList
(from Data.Foldable
) both order things by the primary key. What other behavior are you expecting?
I expected them to be sorted by data's Ord
, like a Set
.
The primary key is the order. If you stick things in any off the shelf database, it comes out ordered by primary key. If you want that order, just make the primary key be the whole table. And if you want to further constrain it, then add additional candidate keys to impart whatever other order you want on it.
Many of my uses of tables
have functions in them. I can't put Ord
on the table itself without giving up structural equality.
view (from table)
returns unsorted list (sorted by primary key only?). Won't hurt to either fix this or add atoAscList
function.