Here's an example:{-# LANGUAGE MagicHash #-}import GHC.Primimport GHC.Typesimport Data.Wordmain :: IO ()main = dolet word = 5 :: Wordres =case word ofW# w -> W# (popCnt64# w)print resOn Sun, Mar 20, 2016 at 12:19 PM, John Ky <newhoggy@gmail.com> wrote:Hello Haskellers,Does anyone know how to call popCnt64# from the GHC.Prim module?This was my failed attempt:λ> popCnt64# 1
<interactive>:14:11:
Couldn't match kind ‘*’ with ‘#’
When matching types
a0 :: *
Word# :: #
Expected type: Integer -> Word#
Actual type: Integer -> a0
In the first argument of ‘popCnt64#’, namely ‘1’
In the expression: popCnt64# 1
In an equation for ‘it’: it = popCnt64# 1-John______________________________________________________________________________________________
Beginners mailing list
Beginners@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
Beginners mailing list
Beginners@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners