3 ms·
OCaml doesn't have argumentless functions.. But they do have functions that take a 'unit' argument.
by eru 10y ago
OCaml doesn't have argumentless functions.. But they do have functions that take a 'unit' argument.
- ernst_klim 10y agoI know, I've asked about this: >The way argumentless functions must be declared with "function". function is just a sugar for fun+match, what does it have to do with argumentlessness?
- sgrove 10y agoI think by "argumentless function" OP just means "a function taking a single, unnamed argument", which is what function does as opposed to fun in OCaml (As you say, function is just sugar for (fun arg -> match arg with .... ) - it's a common enough idiom to have some sugar in the syntax).