This worked...
let rec assoc (value, key, list)= match list with
|[] -> value
| (key', value')::tail -> if key = key' then value' else assoc(value, key, tail);;
|[] -> value
| (key', value')::tail -> if key = key' then value' else assoc(value, key, tail);;
But this didn't...
let rec assoc value key list = match list with
|[] -> value
| (key', value')::tail -> if key = key' then value'
else assoc value key tail;;
No comments:
Post a Comment