What does the #
token mean and how is it used?
newtype IO a = IO (State# RealWorld -> (# State# RealWorld, a #))
I came across this here and wonder where this type is actually defined or weather this is some syntax of a internal type that is ultimately defined in C?
The #
marks the type as an unboxed type. The #
is conventional, but requires an extension (MagicHash
) to make it valid syntax. Likewise, (# ... #)
is the syntax for an unboxed tuple.
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