So I have -
type arg = List of int list | Single of int
let attrList: ( ( arg list -> bool) * string) list ref = ref []
Now I want to append items to attrList using pattern matching -
let rec createAttributeList features =
match features with
[] -> attrList := attrList.contents
|(a,b)::tl -> if (true) then (attrList := (a,b)::attrList.contents) else (createAttributeList tl)
here ‘a’ can be a function with a single argument or two arguments - it could be int or list of int.
How can I accomplish this? Basically, I am adding items from the local list to global list. both lists have same format.