Permalink
Browse files

Trying to get ready for a 0.3.1 update. Some dependency problems pres…

…ently
  • Loading branch information...
1 parent 5c8815a commit 88da16c0fb811862a5de7129167c8aef89595b23 @rrnewton rrnewton committed Oct 6, 2012
View
@@ -310,6 +310,40 @@ The 200% must be from hitting some kind of blackhole to disable the worker?
-----------------
+[2012.10.06] {Strange GHC bug?}
+
+I got into a bad state with ghc-7.4.1 where I would try to import my
+module, and it would appear to succeed, but nothing would be bound.
+
+But then it looks like I could import any old (capitalized) nonsense
+string and it would also appear to succeed!!
+
+ Prelude> import Control.Monad.Par.aoetu
+ <interactive>:1:8: parse error on input `Control.Monad.Par.aoetu'
+ Prelude> import Control.Monad.Par.I
+ Prelude> import Control.Monad.Par.IO
+ Prelude> import Control.Monad.Par.A
+ Prelude> import Control.Monad.Par.BB
+ Prelude> import Control.Monad.Par.BBBBB
+
+Strange. Is it because I just installed a new GHC alongside and am
+now using this old one by appending the extension?
+
+Note, this works even for top-level nonsense modules:
+
+ Prelude> import ENOTHU
+
+This problem is unique to my 7.4.1 install. It doesn't happen under
+7.0 or 7.6.
+
+-------------
+
+Also, don't forget to list "OtherModules" to avoid this:
+
+ Failed to load interface for `Control.Monad.Par.Scheds.DirectInternal'
+ There are files missing in the `monad-par-0.3' package,
+ try running 'ghc-pkg check'.
+ Use -v to see a list of the files searched for.
View
@@ -49,14 +49,17 @@ ifeq ($(CABAL),)
endif
CABAL_INSTALL= ${CABAL} install --with-ghc=${GHC} --with-ghc-pkg=${GHC_PKG} \
- ${CABAL_ARGS}
+ --with-haddock=${HADDOCK} ${CABAL_ARGS}
# --------------------------------------------------------------------------------
# Installation
# --------------------------------------------------------------------------------
install: install-all
+# Example of how to reinstall:
+reinstall:
+ CABAL_ARGS="--force-reinstalls" ${MAKE} install
# Issue a single big cabal command to install everything.
install-with-tests:
@@ -69,7 +72,7 @@ mega-install:
${CABAL_INSTALL} ${ALL_PKGS}
# This one is CUDA SPECIFIC:
-mega-install-gpu:
+mega-install-cuda:
${CABAL_INSTALL} -fcuda ${ALL_GPU_PKGS}
# For Jenkins testing of old GHC versions we are only interested in meta-par and monad-par:
View
@@ -2,20 +2,21 @@
The Par Monad and Friends
=========================
-Please read the package descriptions in './*.cabal'. If you've
+Please read the package descriptions in './*/*.cabal'. If you've
acquired this source package from github you should have the examples/
-subdirectory. Look at examples/README to get started.
+subdirectory. Look at examples/README.md to get started running
+examples.
Here are some commands you may be interested in. First, install
-to *everything* (except for GPU-dependent packages):
+to *everything* (except for GPU/CUDA-dependent packages):
git submodule update --init --recursive
make mega-install
That will install certain dependencies as well (Deques and
accelerate), "make install" just installs the packages directly
contained within this repo. See the Makefile for other things you can
-do (e.g. "make mega-install-gpu").
+do (e.g. "make mega-install-cuda" which depends on CUDA).
Some of the individual packages have test-suites:
@@ -87,7 +87,7 @@ module Control.Monad.Par
(
-- * The Par Monad
Par,
- runPar,
+ runPar, runParIO,
fork,
-- | forks a computation to happen in parallel. The forked
@@ -1,84 +1,44 @@
-{-# LANGUAGE GeneralizedNewtypeDeriving #-}
+{-# LANGUAGE GeneralizedNewtypeDeriving, PackageImports #-}
{- |
-
This module is an alternative version of "Control.Monad.Par" in
which the `Par` type provides `IO` operations, by means of `liftIO`.
The price paid is that only `runParIO` is available, not the pure `runPar`.
This module uses the same default scheduler as "Control.Monad.Par",
and tasks scheduled by the two can share the same pool of worker
- threads.
-
--}
+ threads.
+ -}
module Control.Monad.Par.IO
- ( ParIO, P.IVar,
- runParIO )
+ ( ParIO, P.IVar, runParIO
+ -- And instances!
+ )
where
-- import qualified Control.Monad.Par as P
-- import qualified Control.Monad.Par.Scheds.Trace as P
-- import qualified Control.Monad.Par.Scheds.TraceInternal as TI
+import qualified Control.Monad.Par.Scheds.DirectInternal as PI
import qualified Control.Monad.Par.Scheds.Direct as P
import Control.Monad.Par.Class
import Control.Applicative
-import Control.Monad.IO.Class
+import "mtl" Control.Monad.Trans (lift, liftIO, MonadIO)
-newtype ParIO a = ParIO { unPar :: P.Par a }
+-- | A wrapper around an underlying Par type which allows IO.
+newtype ParIO a = ParIO { unPar :: PI.Par a }
deriving (Functor, Applicative, Monad,
ParFuture P.IVar, ParIVar P.IVar)
+-- | A run method which allows actual IO to occur on top of the Par
+-- monad. Of course this means that all the normal problems of
+-- parallel IO computations are present, including nondeterminsm.
+--
+-- A simple example program:
+--
+-- > runParIO (liftIO$ putStrLn "hi" :: ParIO ())
+runParIO :: ParIO a -> IO a
runParIO = P.runParIO . unPar
instance MonadIO ParIO where
- liftIO io = ParIO (P.Par (lift$ lift io))
--- liftIO (ParIO (P.Par contRdr)) = undefined
-
--- newtype Par a = Par { unPar :: C.ContT () ROnly a }
--- deriving (Monad, MonadCont, RD.MonadReader Sched)
--- type ROnly = RD.ReaderT Sched IO
-
--- newtype Par a = Par {
--- runCont :: (a -> Trace) -> Trace
--- }
-
-
--- import qualified Control.Monad.Par.Class as PC
--- import Control.Monad.Par.Scheds.TraceInternal
--- import Control.DeepSeq
--- import Control.Monad as M hiding (mapM, sequence, join)
--- import Prelude hiding (mapM, sequence, head,tail)
-
--- -- -----------------------------------------------------------------------------
-
--- -- Not in 6.12: {- INLINABLE fork -}
--- {-# INLINE fork #-}
--- fork :: Par () -> Par ()
--- fork p = Par $ \c -> Fork (runCont p (\_ -> Done)) (c ())
-
--- -- --------------------------------------------------------------------------------
--- -- -- Standard instances:
-
--- -- <boilerplate>
--- spawn p = do r <- new; fork (p >>= put r); return r
--- spawn_ p = do r <- new; fork (p >>= put_ r); return r
--- -- </boilerplate>>
-
--- spawnP :: NFData a => a -> Par (IVar a)
--- spawnP a = spawn (return a)
-
--- instance PC.ParFuture IVar Par where
--- get = get
--- spawn = spawn
--- spawn_ = spawn_
--- spawnP = spawnP
-
--- instance PC.ParIVar IVar Par where
--- fork = fork
--- new = new
--- put = put
--- put_ = put_
--- newFull = newFull
--- newFull_ = newFull_
--- -- yield = yield
+ liftIO io = ParIO (PI.Par (lift$ lift io))
Oops, something went wrong.

0 comments on commit 88da16c

Please sign in to comment.