I'm trying to write a custom DivideByInt as follows
type Pair = Pair of int * int with
static member DivideByInt pair int = pair
[<EntryPoint>]
let main argv =
LanguagePrimitives.DivideByInt (Pair(1,2)) 1
|> ignore
0
// compiler error: "FS0001: Method or object constructor 'DivideByInt' not found"
Why's the compiler not finding Pair.DivideByInt?
Pair.DivideByInt
has to take a tuple as input
the corrected version:
type Pair = Pair of int * int with
static member DivideByInt (pair, int) = pair
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With