everyone. I'd like to find an element in an array of records in Purescript but since I'm not familiar with Purescripot, I can't solve it.
I have an array banks which contains bank records.
This is the type of bank record.
type Bank = {
id :: Int,
name :: String
}
I want to get a bank in banks whose id is the same as a given search id.
I tried as following:
find (_.id == searchId) banks
but getting this error.
Could not match type
Int
with type
Function
{ id :: t0
| t1
}
Please help me with this simple issue.