[Haskell-beginners] Re: mayBe stuck
prad at towardsfreedom.com
Thu Aug 5 20:08:51 EDT 2010
On Fri, 06 Aug 2010 00:52:51 +0200
Jürgen Doser <jurgen.doser at gmail.com> wrote:
> But really, you are doing it the wrong way. Your code is traversing
> the list once to find sth. (the findIndex ...), and then traversing
> it again to split it (the take i ...). Why not split directly when
> you find what you are looking for?
ya i will think about this now that the other issue has been explained!
the way i was doing it seemed a bit funny (and i initially tried
findIndices), but couldn't see how to use the limited tools i'm aware
i was wanting to do something like keep pulling characters and make a
new string until the delimiter was found
fn cs = [x | x <- cs, x /= '%'] : 
but can't figure out how to use this idea to actually cause splitting
i also explored break and splitAt, but haven't quite worked out a
mechanism to use those, yet.
thx again for your help.
... with you on your journey
Information, Inspiration, Imagination - truly a site for soaring I's
More information about the Beginners