
Michael:
Thanks, split on would work nicely.
I probably should have backed up in my reasoning process to say that my
real task is to replace a data item in a list with another altered data
item in the same position, or rather in FP, create a new list with the
altered item in the same place. And I need a predicate to find the name of
the item I want to replace.
Any thoughts?
Thanks,
Geoffrey
On Feb 28, 2015 9:08 AM, "Michael Orlitzky"
On 02/27/2015 03:51 PM, Geoffrey Bays wrote:
Hi. An elementary question here about two functions in Data.List: how to use a value from findIndex which returns a Maybe Int, and then use that result in splitAt which takes a regular Int?
Once you understand why you can't feed a (Maybe Int) to a function that takes an Int, throw it all away and use `splitOn` from the "split" package instead =)
https://hackage.haskell.org/package/split-0.2.2/docs/Data-List-Split.html
_______________________________________________ Beginners mailing list Beginners@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners