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
Basically every operation in this library is not very smartly implemented in terms of reducing compile times (e.g. sorting an already sorted list!). Fix this.
Don't re-sort on every insertion, but insert at the right place [Is O(n * log n), could be O (log n)]
delete (and therefore set and modify) resort the map after deletion, when in fact it is already sorted. It may be hard to convince GHC that is already is sorted, though. In any case, submap probably shouldn't be used - we always want to remove just one element.
Settable has a constraint (new ~ Map.AsMap...) to prove something in a costly way that we should already know is true.
In general, I think the right approach is not prove to the compiler that certain operations maintain the set properties, and only have those operations accept sets, but instead just assume the arguments are sets and recover safety by not exposing a way of creating a Book' that doesn't have those properties.
Another interesting possibility is seeing if we can use Data.Type.Equality and unsafeCoerce to have the same type equalities for cheaper.
The text was updated successfully, but these errors were encountered:
Basically every operation in this library is not very smartly implemented in terms of reducing compile times (e.g. sorting an already sorted list!). Fix this.
delete
(and thereforeset
andmodify
) resort the map after deletion, when in fact it is already sorted. It may be hard to convince GHC that is already is sorted, though. In any case,submap
probably shouldn't be used - we always want to remove just one element.Settable
has a constraint (new ~ Map.AsMap...
) to prove something in a costly way that we should already know is true.In general, I think the right approach is not prove to the compiler that certain operations maintain the set properties, and only have those operations accept sets, but instead just assume the arguments are sets and recover safety by not exposing a way of creating a
Book'
that doesn't have those properties.Another interesting possibility is seeing if we can use
Data.Type.Equality
andunsafeCoerce
to have the same type equalities for cheaper.The text was updated successfully, but these errors were encountered: