But in Racket, the interpreter does not show the type:
> cadr
#<procedure:cadr>
Is there a way to show the type of a function?
The types of functions can be broadly classified into four types. Based on Element: One to one Function, many to one function, onto function, one to one and onto function, into function.
In this course we've learned about three types of functions, linear, quadratic and exponential. Linear functions take the form y = m x + b . Quadratic functions take the form y = a x 2 + b x + c . Exponential functions take the form y = a ⋅ b x .
Racket is an untyped language, so there's no equivalent of this information there. However, if you use Typed Racket, a typed dialect of Racket, you'll get exactly this kind of information:
-> string-append
- : (String * -> String)
#<procedure:string-append>
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