Does Haskell have a method for determining the number of CPU cores present on a machine at runtime?
You could copy'n'paste this code into a file called numCores
and compile it with your Haskell code. Than you can use the FFI to import its definition and use it directly in your Haskell code:
{-# LANGUAGE ForeignFunctionInterface #-}
import Control.Applicative ((<$>))
import Foreign.C.Types (CInt)
foreign import ccall "getNumCores" c_getNumCores :: IO CInt
getNumCores :: IO Int
getNumCores = fromEnum <$> c_getNumCores