This language bar is your friend. Select your favorite languages!
Select your favorite languages :
- Or search :
- Clojure
- C++
- C#
- D
- Dart
- Elixir
- Go
- Go
- Haskell
- JS
- JS
- Java
- Java
- Kotlin
- Lisp
- Lua
- PHP
- Pascal
- Perl
- Python
- Python
- Ruby
- Rust
print (dynTypeRep (toDyn x))
Haskell is statically typed with type erasure. But all types member of the Typeable type class can be made into dynamic types by toDyn. We print the type rep which prints the name of the dynamic type.
console.log(typeof x);
In most cases you'll get "object" unless you put in a primitive or function.
{$mode objfpc}{$H+}
{$ModeSwitch ImplicitFunctionSpecialization }
generic procedure PrintTypeOfX<T>(const X: T);
var
tk: TTypeKind;
begin
tk := System.GetTypeKind(X);
writeln(tk);
end;
Requires fpc >= 3.3.1.