Skip to content

Missing import statement in GHC.Event.Poll

See the following section from base's GHC.Event.Poll module:

module GHC.Event.Poll
    (
      new
    , available
    ) where

#include "EventConfig.h"

#if !defined(HAVE_POLL_H)
import GHC.Base

new :: IO E.Backend
new = error "Poll back end not implemented for this platform"

available :: Bool
available = False
{-# INLINE available #-}
#else
#include <poll.h>

import Control.Concurrent.MVar (MVar, newMVar, swapMVar)
import Control.Monad ((=<<), liftM, liftM2, unless)
import Data.Bits (Bits, FiniteBits, (.|.), (.&.))
import Data.Maybe (Maybe(..))
import Data.Monoid (Monoid(..))
import Data.Word
import Foreign.C.Types (CInt(..), CShort(..))
import Foreign.Ptr (Ptr)
import Foreign.Storable (Storable(..))
import GHC.Base
import GHC.Conc.Sync (withMVar)
import GHC.Enum (maxBound)
import GHC.Num (Num(..))
import GHC.Real (ceiling, fromIntegral)
import GHC.Show (Show)
import System.Posix.Types (Fd(..))

import qualified GHC.Event.Array as A
import qualified GHC.Event.Internal as E

Note how there is a missing import qualified GHC.Event.Internal as E when HAVE_POLL_H is not defined.

The same issue is present in master.

This is the error seen (note this is a custom haste build):

Building base-4.7.0.0...
Preprocessing library base-4.7.0.0...
hastec: setNumCapabilities: not supported in the non-threaded RTS

GHC/Event/Poll.hsc:18:11:
    Not in scope: type constructor or class ‘E.Backend’
Edited by ydewit
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information