[nem-en] match / default case

Igor Tkachev it at rsdn.ru
Sun Sep 17 19:51:09 CEST 2006


Hi All,

There is one thing which is bothering me all the time I use pattern
matching. This is default case - | _ => ().

If my match is quite long, it's OK. However, frequently I need to
write something like the following:

match (lst)
{
| Some(a) => Get(a)
| _ => null
}

I mean that there are many cases where we have only one simple match,
nevertheless the whole expression is still unwieldy.

I have no proposition how to solve it, I just do not like it.

Maybe something like that?

match (lst, null)
{
| Some(a) => Get(a)
}

match (lst) (null)
{
| Some(a) => Get(a)
}

-- 
Best regards,
Igor
mailto:it at rsdn.ru





More information about the devel-en mailing list