typeOf

Observe a type representation for the type of a value.
Given a JStgExpr, return the its type.
Not on Stackage, so not searched. Small script for inferring types
typeof x
asTypeOf is a type-restricted version of const. It is usually used as an infix operator, and its typing forces its first argument (which is usually overloaded) to have the same type as the second.
The outer type constructor of the type
asProxyTypeOf is a type-restricted version of const. It is usually used as an infix operator, and its typing forces its first argument (which is usually overloaded) to have the same type as the tag of the second.
>>> import GHC.Internal.Word

>>> :type asProxyTypeOf 123 (Proxy :: Proxy Word8)
asProxyTypeOf 123 (Proxy :: Proxy Word8) :: Word8
Note the lower-case proxy in the definition. This allows any type constructor with just one argument to be passed to the function, for example we could also write
>>> import GHC.Internal.Word

>>> :type asProxyTypeOf 123 (Just (undefined :: Word8))
asProxyTypeOf 123 (Just (undefined :: Word8)) :: Word8
Byte offset of the closure type half-word