My attempt to do this is here (forgive the for loop - I was just curious to see if this was possible):
let (|>>) a (b : ('a -> unit) list) =
for x in b do
x a
but when I try to use it I get the error
"f(a) is defined" means f is a function, and a is in the domain of f. For example suppose f(x)=1x. f(1) is defined.
Since you cannot divide by 0, the function is not defined when x=a. The function is undefined at a.
To prove a function is One-to-One To prove f:A→B is one-to-one: Assume f(x1)=f(x2) Show it must be true that x1=x2. Conclude: we have shown if f(x1)=f(x2) then x1=x2, therefore f is one-to-one, by definition of one-to-one.
The function f:N → N ( N is the set of natural numbers) defined by f(n) = 2n + 3 is. SolveStudyTextbooksGuides.
That None of the types error
message can occur if the function you're trying to use is defined further down the file or isn't imported correctly. Otherwise, your function definition seems ok.
I would discourage the use of a custom operator for this. I think they should be used very rarely. This one doesn't seem general enough to be worth defining and could make code hard to read. Here is one alternative:
[ printf "%A"; printfn "%A" ] |> List.iter ((|>) 1)
But it's even clearer and shorter to write out your operator definition inline:
for f in [ printf "%A"; printfn "%A" ] do f 1
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