list icon indicating copy to clipboard operation
list copied to clipboard

Ord typeclass

Open goodmind opened this issue 7 years ago • 5 comments

How can you use this list with Ord ?

goodmind avatar Apr 11 '18 14:04 goodmind

Hello @goodmind. I'm not sure if I understand your question.

If you have a list of values that implements Ord you can sort the list of them with sort.

But, List itself does not implement Ord _yet. This is planned though. Do you need the Ord instance? Because if you do I can make implementing it a higher priority.

paldepind avatar Apr 11 '18 18:04 paldepind

I have static-land Ord actually

goodmind avatar Apr 11 '18 19:04 goodmind

I'm sorry, what do you mean? :smile: :question:

paldepind avatar Apr 12 '18 05:04 paldepind

I mean how do I sort list of items with static-land Ord? https://github.com/rpominov/static-land/blob/master/docs/spec.md#ord

goodmind avatar Apr 12 '18 06:04 goodmind

@goodmind I would think you could use sortWith, passing your own function that uses lte.

gabejohnson avatar May 04 '18 18:05 gabejohnson