What is the meaning of '#'?

STM (State# RealWorld -> (#State# RealWorld, a#))

#doesn't appear in the list of Haskell statements, and google doesn't bring anything useful. Ghci:>:t (#): variable is not in scope.

So what does this character do? And why is it used in the above code snippet (from STM)?

+4
source share
1 answer

You need an extension of the language so that it can use it, that it is special!

It does nothing, it's just a special kind of character that GHC people see how to use in the names of low-level, possibly boxing-related things.

Here (# a, b #), which is a type of unboxed tuple aand bwhich you see there is not ( #State# , ..., it (# State#, ....

+5
source

Source: https://habr.com/ru/post/1654974/


All Articles