Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

A style I sometimes see is people not indenting the normal code path of the match. So your example above would be written:

    match user with
    | None -> printf "you need to specify a user\n"; None
    | Some user_id when not (permitted user_id) ->
	printf "this user is not permitted\n"; None
    | Some user_id ->
    // go ahead and return Some object


Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: