> type Either<'a, 'b> = Left of 'a | Right of 'b
-
- ;;
type Either<'a,'b> =
| Left of 'a
| Right of 'b
> ;;
> let fold f g = function Left a -> f a | Right b -> g b
- ;;
val fold : f:('a -> 'b) -> g:('c -> 'b) -> _arg1:Either<'a,'c> -> 'b
В репле выводит