In haskell, negative numbers come from using the unary operator '-' before the number, but the subtraction function also uses '-' . Therefore, when you enter :t (-) in ghci, you only get the result of the type of the subtraction function, for example
:t (-) (-) :: Num a => a -> a -> a
But is it possible to get the type of "negation operator" in ghci? I know this is trivial, but I'm curious.
haskell
richard.g
source share