Slacker News Slacker News logo featuring a lazy sloth with a folded newspaper hat
  • top
  • new
  • show
  • ask
  • jobs
Library

Comment by munchler

21 hours ago

Simple example:

   type Expr =
       | Primitive of int
       | Addition of (Expr * Expr)
       | Subtraction of (Expr * Expr)
       | Negation of Expr

3 comments

munchler

Reply

Quarrelsome  21 hours ago

Isn't that just Func<int> ?

  • afdbcreid  21 hours ago

    Really not. You can, of course, having instead a delegate to evaluate the expression. But then that's all you can do. You can't pretty-print it, for example, or optimize it, or whatever.

Slacker News

Product

  • API Reference
  • Hacker News RSS
  • Source on GitHub

Community

  • Support Ukraine
  • Equal Justice Initiative
  • GiveWell Charities