Just to add to David's answer, when I find myself in situations like:foo >>= return . barhlint helpfully suggests:fmap bar fooSo you could also have:fmap (splitOn ",") $ readFile "data.txt"-valeOn Mon, Dec 11, 2017 at 4:24 PM, mike h <mike_k_houghton@yahoo.co.uk> wrote:Thank you David. Before posting I tried readFile "data.txt" >>= … but got errors as I didn’t use return.!!MikeOn 11 Dec 2017, at 21:00, David McBride <toad3k@gmail.com> wrote:readFile "data.txt" >>= return . splitOn ","splitOn "," <$> readFile "data.txt"or perhaps______________________________On Mon, Dec 11, 2017 at 3:56 PM, mike h <mike_k_houghton@yahoo.co.uk> wrote:I have
input <- readFile “data.txt”
let input’ = splitOn “,” input
….
How do I make that into just one line?
Thanks
Mike
_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
_________________
Beginners mailing list
Beginners@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners