<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>hi carl,</div>

<div> </div>

<div>i hope this seven-step program will help you with your problem.</div>

<div> </div>

<div>1.) this is a very-very-beginner's question. (and yet you use Typeable and Generics, so this is most likely some copy-pasted code.) so be aware and know your problem: that you are not even a beginner and that you shall not trust your assumptions.</div>

<div>i'm sure you are not allone with your problem; there is that pseudonymous group... https://mail.haskell.org/mailman/listinfo/beginners</div>

<div>2.) read up about Monads&Gonads or Monads&Burritos... or maybe later, but then take your time. one day or weekend could be enough. but first know:</div>

<div>2b.) IO ByteString is a program snippet (input-output-operation) that produces a ByteString. it is not a ByteString itself, it is some executable program code; you need to run it and do something with its output.</div>

<div>
<div><span style="line-height: 1.6em;">3.) you did not write about any imports, so i don't know the type Process, but if Process is IO, then try this (if it doesn't work, give us more information about those types and/or libraries you did hide from us):</span></div>
</div>

<div>do</div>

<div>  jj<-j</div>

<div>  sendChan chan (IBuf jj) </div>

<div>
<div>
<div>
<div>4.) you wrote "<span style="line-height: 1.6em;">Process()" instead of "Process ()", which *looks* to many haskellers like you might misguidedly assume that it is some kind of function or method with params in those parentheses? in that case, in order to understand types, you might want to investigate and experiment with Data.Maybe, Data.List, Data.Either, and Data.Functor using ghci.</span></div>
5.) now that you know that an Int is-not-an [Int] is-not-a String is-not-any IO String ... nor any Duck a Maybe Duck but Just a Duck ...  read up about Monads. then use ghci to explore Control.Monad and use the "do-notation".</div>
6.) blog about why and how a list (that are these cute brackets "[]" called list -- and not that null-tuple "()" called unit) is a Monad</div>

<div>7.) congrats, now you are a beginner.</div>

<div> </div>

<div> </div>

<div name="quote" style="margin:10px 5px 5px 10px; padding: 10px 0 10px 10px; border-left:2px solid #C3D9E5; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div style="margin:0 0 10px 0;"><b>Gesendet:</b> Donnerstag, 09. Juni 2016 um 14:07 Uhr<br/>
<b>Von:</b> "Carl Petersen" <cepete02@gmail.com><br/>
<b>An:</b> Haskell-cafe <haskell-cafe@googlegroups.com><br/>
<b>Betreff:</b> [Haskell-cafe] couldn't match expected type ByteString with actual type IO ByteString</div>

<div name="quoted-content">
<div>Hello All,<br/>
<br/>
I'm getting the following error:<br/>
<br/>
/apps/workspace/hade/src/Step/ReadExcel.hs:39:23:<br/>
    Couldn't match expected type ‘L.ByteString’<br/>
                with actual type ‘IO L.ByteString’<br/>
    In the first argument of ‘IBuf’, namely ‘j’<br/>
    In the second argument of ‘sendChan’, namely ‘(IBuf j)’<br/>
<br/>
<br/>
when I compile the following code:<br/>
<br/>
data Buf = IChan (SendPort Buf) | IBuf (L.ByteString) deriving (Show,Generic,Typeable)<br/>
<br/>
instance Binary Buf<br/>
<br/>
readExcel :: Process()<br/>
readExcel = do<br/>
  sendChan chan (IBuf j)<br/>
 where<br/>
    IChan chan = expect<br/>
    j = do<br/>
      r <- toTableRowsFromFile 8 "final-project.xlsx"<br/>
      let b = A.encode r<br/>
      return b<br/>
<br/>
remotable ['readExcel]<br/>
<br/>
Any ideas as to what I'm doing wrong?<br/>
<br/>
Carl<br/>
 </div>
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org <a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a></div>
</div>
</div></div></body></html>