if it’s null i want to return addSearch(carsListin...
# getting-started
o
if it’s null i want to return addSearch(carsListingParameters) without the map, hmmm but those are two different datatypes then ..
j
In general you can use an Optional type to avoid doing the work when the contained value is null. You can also use an Either type if you need to return one of two distinct data types. They're both provided by arrow (although they're both pretty common and lots of other libraries provide equivalent types).