[Haskell-cafe] couldn't match expected type ByteString with actual type IO ByteString

Carl Petersen cepete02 at gmail.com
Thu Jun 9 12:07:46 UTC 2016

Hello All,

I'm getting the following error:

    Couldn't match expected type ‘L.ByteString’
                with actual type ‘IO L.ByteString’
    In the first argument of ‘IBuf’, namely ‘j’
    In the second argument of ‘sendChan’, namely ‘(IBuf j)’

when I compile the following code:

data Buf = IChan (SendPort Buf) | IBuf (L.ByteString) deriving 

instance Binary Buf

readExcel :: Process()
readExcel = do
  sendChan chan (IBuf j) 
    IChan chan = expect
    j = do
      r <- toTableRowsFromFile 8 "final-project.xlsx"
      let b = A.encode r 
      return b

remotable ['readExcel]

Any ideas as to what I'm doing wrong?


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20160609/acbfb579/attachment.html>

More information about the Haskell-Cafe mailing list