You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently attempting to sort a relation by an attribute that has a constructed type throws an AttributeNotSortableError. This is really limiting, since even a simple Maybe type becomes unsortable as well.
I think we need a solution that behaves like sortBy which takes an AtomFunction or maybe something like a ValueExtractionExpr (which behaves like a RelationalExpr) and provides the value on which the sort should be done.
Any Ideas on this?
The text was updated successfully, but these errors were encountered:
I can see how that would be annoying indeed. Thus far, I've been avoiding implementing typeclass support at the Atom level, but it might be required. It doesn't make sense (to me, at least) that all Atoms must be sortable.
We'll need to implement some basic typeclass support. Are there other typeclasses that would make sense to have as built-ins?
I'm not sure how the typeclass would work but let's say this is how it would work for these types for example:
Maybe a: Just a values first, then Nothings. While Just as are sorted themselves by as. How as are sorted should be determined by the typeclass for as.
Either a b: Right bs first then Left as, while Rights and Lefts are sorted based on their values.
Generally types would provide their own compare function or a way to extract a value from the atom that implements Ord typeclass.
These are my initial thoughts on how it would work. Hope it makes sense.
As the user, maybe I could extend the relation and put a sortable atom inside an attribute using an atom function, sort on it and remove it later. But a db level solution would be preferred.
Currently attempting to sort a relation by an attribute that has a constructed type throws an
AttributeNotSortableError
. This is really limiting, since even a simpleMaybe
type becomes unsortable as well.I think we need a solution that behaves like
sortBy
which takes anAtomFunction
or maybe something like aValueExtractionExpr
(which behaves like aRelationalExpr
) and provides the value on which the sort should be done.Any Ideas on this?
The text was updated successfully, but these errors were encountered: