.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
data NntpManager   = NntpManager {
      server    :: String,
      username  :: String,
      password  :: String,
      port      :: PortID,
      maxCons   :: Int,
      taskQueue :: MVar [NntpTask], -- All tasks must be 
                                    -- in here exactly once at all times (Unless killed)
      taskCount :: MVar Int -- Only used for making task uids
} 

data NntpTask = NntpTask {
      uid :: Int,
      manager :: NntpManager,
      action :: forall b . MVar (            MVar (Nntp b), 
                                             (Handle -> Nntp b)
                                )
}  

createNntpTask :: NntpManager -> IO NntpTask
createNntpTask man = do
  oldTaskCount <- takeMVar (taskCount man)
  let newTaskCount = oldTaskCount + 1
  putMVar (taskCount man) newTaskCount
  act <- newEmptyMVar 
  let value = NntpTask { ----------------------- This is line 85
                       uid     = oldTaskCount,
                       manager = man,
                       action  = act
                       }              
  modifyMVar_ (taskQueue man) (return . (++ [value]))
  return value

---------------------------------------------------------------

Nntp.hs:85:14:
    Inferred type is less polymorphic than expected
      Quantified type variable `b' is mentioned in the environment:
        act :: MVar (MVar (Nntp b), Handle -> Nntp b)
          (bound at Nntp.hs:84:2)
    In the `action' field of a record
    In the expression:
        NntpTask {uid = oldTaskCount, manager = man, action = act}
    In the definition of `value':
        value = NntpTask {uid = oldTaskCount, manager = man, action = act}
Failed, modules loaded: YEnc.