Skip to content

Instantly share code, notes, and snippets.

@codedmart
Created July 19, 2015 14:48
Show Gist options
  • Select an option

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

Select an option

Save codedmart/a84f7ea215b221642625 to your computer and use it in GitHub Desktop.
liftIO $ forkIO $ forever $ next cursor >>= \c -> do
case c of
Nothing -> undefined
Just x -> do
let u = resultToMaybe $ fromDatum x :: Maybe ChangeUser
case u of
Nothing -> undefined
Just user -> SocketIO.emit "changes" (Changes user)
Api/Lib/Chat.hs:122:32:
Could not deduce (Control.Monad.Reader.Class.MonadReader
SocketIO.Socket IO)
arising from a use of ‘SocketIO.emit’
from the context (Control.Monad.State.Class.MonadState
SocketIO.RoutingTable m,
Control.Monad.IO.Class.MonadIO m)
bound by the inferred type of
eioServer :: (Control.Monad.State.Class.MonadState
SocketIO.RoutingTable m,
Control.Monad.IO.Class.MonadIO m) =>
ServerState
-> Data.Pool.Pool Database.RethinkDB.Network.RethinkDBHandle
-> m ()
at Api/Lib/Chat.hs:(107,1)-(156,58)
In the expression: SocketIO.emit "changes" (Changes user)
In a case alternative:
Just user -> SocketIO.emit "changes" (Changes user)
In a stmt of a 'do' block:
case u of {
Nothing -> undefined
Just user -> SocketIO.emit "changes" (Changes user) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment