I am trying to convert a function from using the pipe forward operator to use the forward composition.
let four_digit_number_has_all_different_digits digits =
digits
|> Seq.distinct
|> Seq.length
|> (=) 4
Here is my attempt to convert it -
let four_digit_number_has_all_different_digits =
Seq.distinct
>> Seq.length
>> (=) 4
FSI gives me this error -
error FS0030: Value restriction. The value 'four_digit_number_has_all_different_digits' has been inferred to have generic type
val four_digit_number_has_all_different_digits : ('_a -> bool) when '_a :> seq<'_b> and '_b : equality
Either make the arguments to 'four_digit_number_has_all_different_digits' explicit or, if you do not intend for it to be generic, add a type annotation.
In a simple case where the types remain the same removing the initial value and replacing |> with >> works. Can or should I be trying to use forward composition here? And if I should, how do I correct the error?