1) Is this architecture appropriate?
This, of course, is not a bad approach :)
, , - ? , #.
2) , - , ?
F # # . , # dll F # , . , F #, #. funsies, , Reflector:
let f x y z = x(y z)
let (|A|B|C|) x =
match x with
| 1 -> A
| 2 -> B
| x -> C x
type whatever = X | Y | Z of int
FSharpFunc, , .. #, , , # , . :
module CSharpFacade =
let f(x : System.Func<_, _>, y : System.Func<_, _>, z) = f (fun param -> x.Invoke(param)) (fun param -> y.Invoke(param)) z
[<AbstractClass>]
type Whatever() =
inherit obj()
abstract member Map : unit -> whatever
type X() =
inherit Whatever()
override this.Map() = whatever.X
type Y() =
inherit Whatever()
override this.Map() = whatever.Y
type Z(value : int) =
inherit Whatever()
member this.Value = value
override this.Map() = whatever.Z(value)
, , F # #. , , .
Some/None , , Option<someValueType> Nullable<someValueType> null None , , ..