<div dir="ltr">No worries. I definitely should have mentioned fmap and <$> are the same.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 12, 2017 at 1:43 PM, Vale Cofer-Shabica <span dir="ltr"><<a href="mailto:vale.cofershabica@gmail.com" target="_blank">vale.cofershabica@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>I now, of course, feel silly because <$> is the infix version of fmap; apologies for list-spamming.</div><div><br></div><div>-vale<br></div></div><div class="gmail_extra"><br clear="all"><div><div class="m_3852884235408818445gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>--<br>vale cofer-shabica<br><a href="tel:(401)%20267-8253" value="+14012678253" target="_blank">401.267.8253</a></div></div></div></div><div><div class="h5">
<br><div class="gmail_quote">On Tue, Dec 12, 2017 at 1:41 PM, Vale Cofer-Shabica <span dir="ltr"><<a href="mailto:vale.cofershabica@gmail.com" target="_blank">vale.cofershabica@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Just to add to David's answer, when I find myself in situations like:</div><div>foo >>= return . bar</div><div><br></div><div>hlint helpfully suggests:</div><div></div><div>fmap bar foo</div><div><br></div><div>So you could also have:</div><div>fmap (splitOn ",") $ readFile "data.txt"<br></div><div><br></div><div></div><div>-vale<br></div><div class="gmail_extra"><br clear="all"><div><div class="m_3852884235408818445m_1630006946305475400gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>--<br>vale cofer-shabica<br><a href="tel:(401)%20267-8253" value="+14012678253" target="_blank">401.267.8253</a></div></div></div></div><div><div class="m_3852884235408818445h5">
<br><div class="gmail_quote">On Mon, Dec 11, 2017 at 4:24 PM, mike h <span dir="ltr"><<a href="mailto:mike_k_houghton@yahoo.co.uk" target="_blank">mike_k_houghton@yahoo.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Thank you David. Before posting I tried readFile "data.txt" >>= … but got errors as I didn’t use return.!! <span class="m_3852884235408818445m_1630006946305475400HOEnZb"><font color="#888888"><div><br></div></font></span><div><span class="m_3852884235408818445m_1630006946305475400HOEnZb"><font color="#888888">Mike</font></span><div><div class="m_3852884235408818445m_1630006946305475400h5"><br><div><br></div><div><br><div><blockquote type="cite"><div>On 11 Dec 2017, at 21:00, David McBride <<a href="mailto:toad3k@gmail.com" target="_blank">toad3k@gmail.com</a>> wrote:</div><br class="m_3852884235408818445m_1630006946305475400m_9043682756874592164Apple-interchange-newline"><div><div dir="ltr"><div><div>splitOn "," <$> readFile "data.txt"<br><br></div>or perhaps<br><br></div>readFile "data.txt" >>= return . splitOn ","<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Dec 11, 2017 at 3:56 PM, mike h <span dir="ltr"><<a href="mailto:mike_k_houghton@yahoo.co.uk" target="_blank">mike_k_houghton@yahoo.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I have<br>
<br>
input <- readFile “data.txt”<br>
let input’ = splitOn “,” input<br>
….<br>
<br>
How do I make that into just one line?<br>
<br>
Thanks<br>
<br>
Mike<br>
______________________________<wbr>_________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@haskell.org" target="_blank">Beginners@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bi<wbr>n/mailman/listinfo/beginners</a><br>
</blockquote></div><br></div>
______________________________<wbr>_________________<br>Beginners mailing list<br><a href="mailto:Beginners@haskell.org" target="_blank">Beginners@haskell.org</a><br><a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners" target="_blank">http://mail.haskell.org/cgi-bi<wbr>n/mailman/listinfo/beginners</a><br></div></blockquote></div><br></div></div></div></div></div><br>______________________________<wbr>_________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@haskell.org" target="_blank">Beginners@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bi<wbr>n/mailman/listinfo/beginners</a><br>
<br></blockquote></div><br></div></div></div></div>
</blockquote></div><br></div></div></div>
<br>______________________________<wbr>_________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@haskell.org">Beginners@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-<wbr>bin/mailman/listinfo/beginners</a><br>
<br></blockquote></div><br></div>