You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using haskell-ide-engine (commit cc71e5bd, and the version of HaRe that this depends on) with Sublime Text HST and when renaming the function name at this line with it to pooledMapConcurrently2, it modifies the file like so:
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TupleSections #-}
modulePooledMapConcurrentlypooledMapConcurrently2:: (Traversablet, MonadIOm, Async.Forall (Async.Purem), MonadBaseControlIOm) => (a->mb) ->ta->m (tb)
pooledMapConcurrently2 f xs =do
, pooledMapConcurrently'
) whereimportControl.Concurrent.Async.Lifted (Concurrently(..))
importqualifiedControl.Concurrent.Async.Lifted.SafeasAsyncimportControl.Concurrent.MVar.LiftedimportControl.Monad.TransimportControl.Monad.Trans.ControlimportData.IORefimportData.FoldableimportData.TraversableimportGHC.Conc (getNumCapabilities)
( pooledMapConcurrently2numProcs <- liftIOgetNumCapabilitiespooledMapConcurrently'numProcsfxspooledMapConcurrently' :: foralltmab . (Traversablet, MonadIOm, Async.Forall (Async.Purem), MonadBaseControlIOm) => Int -> (a -> mb) -> t a -> m (tb)
pooledMapConcurrently' numThreads f xs =if numThreads <1thenerror ("pooledMapConcurrently: numThreads < 1 ("++show numThreads ++")")
elsedo
jobs ::t (a, IORefb) <- liftIO $ for xs (\x -> (x, ) <$> newIORef (error"pooledMapConcurrently: empty IORef"))
jobsVar ::MVar [(a, IORefb)] <- liftIO $ newMVar (toList jobs)
runConcurrently $ for_ [1..numThreads] $\_ ->Concurrently$dolet loop ::m()
loop =do
m'job ::Maybe (a, IORefb) <- liftIO $ modifyMVar jobsVar $\case[]->return ([], Nothing)
var : vars ->return (vars, Just var)
for_ m'job $\(x, outRef) ->do
y <- f x
liftIO $ atomicWriteIORef outRef y
loop
loop
liftIO $ for jobs (\(_, outputRef) -> readIORef outputRef)
Note the broken exports list and the function losing its type signature and first line.
The text was updated successfully, but these errors were encountered:
I'm using haskell-ide-engine (commit
cc71e5bd
, and the version of HaRe that this depends on) with Sublime Text HST and when renaming the function name at this line with it topooledMapConcurrently2
, it modifies the file like so:Note the broken exports list and the function losing its type signature and first line.
The text was updated successfully, but these errors were encountered: