No, you can't use the discriminators (or "case tags", or "labels") as types. You can realize this via

1
2
3
4
5
6
type Expr =
    | EVar of Var           // Variable
    | EAbs of Var * Expr    // Abstraction
    | EApp of Expr * Expr   // Application
and Var =
    | VVar of string        // Variable

where I've done some renaming to avoid ambiguities, or just get rid of the Var type and use "string" in its place.

By on 10/25/2008 12:10 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper