Skip to content

Instantly share code, notes, and snippets.

@codedmart
Last active August 29, 2015 14:25
Show Gist options
  • Select an option

  • Save codedmart/9904c93cc224dbcd3e53 to your computer and use it in GitHub Desktop.

Select an option

Save codedmart/9904c93cc224dbcd3e53 to your computer and use it in GitHub Desktop.
Couldn't match expected type ‘IO () -> m a0’
with actual type ‘IO ()’
Relevant bindings include
eioServer :: ServerState
-> Data.Pool.Pool Database.RethinkDB.Network.RethinkDBHandle
-> m ()
(bound at Api/Lib/Chat.hs:80:1)
The first argument of ($) takes one argument,
but its type ‘IO ()’ has none
In a stmt of a 'do' block:
threadDelay 5000
$ do { c <- next cursor;
case c of {
Nothing -> print "Nothing one"
Just x -> do { ... } } }
In the expression:
do { userNameMVar <- liftIO STM.newEmptyTMVarIO;
let forUserName m
= liftIO (STM.atomically (STM.tryReadTMVar userNameMVar))
>>= mapM_ m;
cursor <- liftIO $ User.listRawChanges pool;
threadDelay 5000
$ do { c <- next cursor;
case c of {
Nothing -> ...
Just x -> ... } };
.... }
cursor <- liftIO $ User.listRawChanges pool
threadDelay 5000 $ do
c <- next cursor
case c of
Nothing -> print "Nothing"
Just x -> do
let u = resultToMaybe $ fromDatum x :: Maybe [SecureUser]
case u of
Nothing -> print "Nothing"
Just users -> print users
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment