Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does F# have a way to print the type of an expression?

Tags:

f#

I'm looking for the moral equivalent of ghci's:

Prelude> :t 1 + 2
1 + 2 :: Num a => a
like image 502
Steven Shaw Avatar asked May 20 '15 09:05

Steven Shaw


People also ask

What does f x → Y mean?

A function f from X to Y is an object that, for each element x ∈ X, assigns an element y ∈ Y . We use the notation f : X → Y to denote a function as described. We write f(x) = y or f : x ↦→ y to denote that the element in Y assigned to x is y. We call X the domain of f, and we call Y the codomain of f.

Does f mean derivative?

Derivative as a functionLet f be a function that has a derivative at every point in its domain. We can then define a function that maps every point x to the value of the derivative of f at x. This function is written f′ and is called the derivative function or the derivative of f.

What does f say about f and f?

f, f′ and f″ Since (f′)′=f″, when f′ is increasing, f″ is positive. Similarly, when the slopes of tangent lines are decreasing, i.e. when f′ is decreasing, the function is concave down, as you can see in the second two graphs below. Since (f′)′=f″, when f′ is decreasing, f″ is negative.


1 Answers

In F# Interactive you get that after each execution:

> (+);;
val it : (int -> int -> int) = <fun:it@1>
> 1 + 2;;
val it : int = 3
> printfn "Hi";;
Hi
val it : unit = ()
like image 106
rasmusm Avatar answered Sep 30 '22 06:09

rasmusm