I am trying to teach my self F# by porting some Haskell Code.
Specifily I am trying to port the Countdown Problem shown here
The Haskell Code is listed here
I am trying to create the following Haskell types in F#:
data Op = Add | Sub | Mul | Div
data Expr = Val Int | App Op Expr Expr
In F# I think Op type is defined as follows:
type Op = | Add | Sub | Mul | Div
I am having issues with the Expr type.
How does one create a recursive type? From this SO question it looks like one can not create the Expr type in F#.
Also what is the F# equivalent of 'App' type which apply s the Op type to the Expr type.
If it is not possible to directly port this code, could someone suggest an alternative data structure.