CPN ML: how do i get a product containing a certain element, from a list

277 Views Asked by At

I'm trying to make a function with arguments a and bs, that will check if list bs contains a product whos first element is a. If list bs contains a product whos first element is a, then that product is returned.

The function is giving a nondescriptive error relating to a file "evalloop.sml".

fun matchFirstElement ([], _) = ("V70",["2.4T","V70a1"],(20,25),"MT1") |
matchFirstElement (b::bs, a) = if (a = #1 b) then b else getProdRule(bs, a);
0

There are 0 best solutions below