Skip to main content

Type Inference

> :t \x -> x +1
Int -> Int

> :t \x -> x <> "!"
String -> String

> :t \x -> x <> x
forall (a2 :: Type). Semigroup a2 => a2 -> a2

> :t \x -> x + x
forall (a2 :: Type). Semiring a2 => a2 -> a2

> :t (<>)
forall (@a :: Type). Semigroup a => a -> a -> a

> :t (+)
forall (@a :: Type). Semiring a => a -> a -> a

:k xx: xx must be upper case, it's a type :t yy: yy must be lower case, it's a value