<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="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>--<br>vale cofer-shabica<br>401.267.8253</div></div></div></div>
<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="HOEnZb"><font color="#888888"><div><br></div></font></span><div><span class="HOEnZb"><font color="#888888">Mike</font></span><div><div class="h5"><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_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-<wbr>bin/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">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></div>