Replies: 3 comments
-
Please give me advice or sample if you have, thanks @nielstron |
Beta Was this translation helpful? Give feedback.
-
I recommend you don't actually sort inside the validator (too expensive!) but expect the caller to pass in a sorted list. you can then just check that subsequent elements are <= if you really want to sort, you need to implement something that works on immutable lists, i.e. not in-place like merge sort |
Beta Was this translation helpful? Give feedback.
-
oke, thanks. i know how it cost but sometime still need to do that while checking logic. haskell have built in sort function, just ask to be sure 'bout that :p |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
All reactions