I'm trying to split a list in Haskell. As to my knowledge, the easiest way to do this is with splitOn
, but this function requires Data.List.Split
, so I tried to run import Data.List.Split
in Prelude. However, I got the following error:
Could not find module Data.List.Split
Simply importing Data.List
does work, however.
What could I do to solve this? Or, even better: is there an easy, built-in alternative to split lists?
Data.List.Split
is not in the base I think you'll have to install split
after the clarification in the comments that only splitting on whitespace is required - use words
/lines
to your need - see also @Zeta's answer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With