Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I see the type for operators in F# interactive?

Tags:

f#

I am trying to explore the type of operators such as :: in F# interactive.

But I get these kinds of messages:

Unexpected symbol '::' in expression. Expected ')' or other token.

even if I surround it with (::).

like image 252
unj2 Avatar asked Dec 17 '22 16:12

unj2


1 Answers

I do it like this:

> let inline showmecons a b = a :: b;;

val inline showmecons : 'a -> 'a list -> 'a list

or

> let inline showmepow a b = a ** b;;

val inline showmepow :
   ^a ->  ^b ->  ^a when  ^a : (static member Pow :  ^a *  ^b ->  ^a)
like image 168
Stephen Swensen Avatar answered Jan 13 '23 09:01

Stephen Swensen