mardi 21 avril 2020

Haskell if-construct that returns nothing on `else`

is there a way where a construct like (pseudo code):

test (a,b) = if a > 10 then a else null

in Haskell. If you map over a list I can use filter to do this, but I would like a similar construct using if then else.

Aucun commentaire:

Enregistrer un commentaire