Using Foq with F# function types
问题 I am using F# type definitions to prevent hard dependencies between my functions, for example type IType1 = int -> int type IType2 = int-> string let func1 (i : int) : int = i * i let func2 (i : int) : string = i |> string let higherFunc (dep1 : IType1) (dep2 : IType2) (input : int) : string = input |> dep1 |> dep2 let curriedFunc = higherFunc func1 func2 let x = curriedFunc 2 output x : "4" Obviously this is quite contrived and simple but imagine the dependencies are a parser and a sorter or