
What does # mean in this code ? (from Data.List) findIndices p ls = loop 0# ls where loop _ [] = [] loop n (x:xs) | p x = I# n : loop (n +# 1#) xs | otherwise = loop (n +# 1#) xs -- View this message in context: http://haskell.1045720.n5.nabble.com/Operator-tp3299360p3299360.html Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.

On Thu, Dec 9, 2010 at 8:31 PM, c8h10n4o2
What does # mean in this code ? (from Data.List)
It's a "magic hash" denoting here on the one hand unboxed machine ints (0#) and on the other the constructor wrapping such a raw machine int to a Haskell boxed Int (I#). GHC uses the magic hash to mark raw unboxed stuff (which you'll rarely need to use). In the libraries, sometimes using the raw machine data types (Int#, Word#, Double#, Float# and a few more) is needed for better performance.
participants (2)
-
c8h10n4o2
-
Daniel Fischer