How I can declare function that takes number and list of numbers, and returns NONE if there is no such number in the list, otherwise returns list option (‘Maybe’ in Haskell) without this number? If there more then one such number, function has to erase just first of them.
all_except_one : 'a * 'a list -> 'a list option
I have no idea how to do it :\
I ask any code in any language, just some tip about algorithm in functional style (initially I have to solve this problem in SML). Also I can’t use higher order functions in my task.
what about this solution ?
The same without helper function and without tail recursion.