Re:fork() can fail
by masklinn on Thursday August 21, 2014 @04:14AM
(#8206374)
A "Choice" (Either in Haskell, Result in Rust) wouldn't work for fork() as it can have 3 results, and you'd want the `Child` case cleanly and easily separated from `Pid`.
[ Parent
| on HN ]
I think the parent meant only a sum type, not a concrete example of it such as Either of Haskell, which would surely not suffice here. In Haskell you would probably define a new sum type for this occasion, e.g.:
data ForkResult = Failure | Parent Int | Child