Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (* implementing an interface on a discriminated union in F# *)
- type IMiddle =
- abstract Middle : String with get
- type Either<'a, 'b> =
- | Left of 'a
- | Right of 'b
- interface IMiddle with
- member this.Middle = "middle!"
- let x = Left 110
- let mdl = (x :> IMiddle).Middle
Add Comment
Please, Sign In to add comment