funkia / list

🐆 An immutable list with unmatched performance and a comprehensive functional API.
MIT License
1.65k stars 51 forks source link

Ord typeclass #37

Open goodmind opened 6 years ago

goodmind commented 6 years ago

How can you use this list with Ord ?

paldepind commented 6 years ago

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.

goodmind commented 6 years ago

I have static-land Ord actually

paldepind commented 6 years ago

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

goodmind commented 6 years ago

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

gabejohnson commented 6 years ago

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