logoalt Hacker News

Quarrelsomeyesterday at 9:38 PM2 repliesview on HN

> so the use cases are plentiful

such as?

> This should reduce the proliferation of verbose class hierarchies in C#

So just as an alternative for class hierarchies? I mean good people already balance that by having a preference for composition.


Replies

munchleryesterday at 9:49 PM

Simple example:

   type Expr =
       | Primitive of int
       | Addition of (Expr * Expr)
       | Subtraction of (Expr * Expr)
       | Negation of Expr
show 1 reply
LeFantomeyesterday at 10:01 PM

“Compoision”. A typo I know but it would be a word describing what goes wrong with class hierarchies.