[Haskell-cafe] Re: dropping hyphens and \n in words

Achim Schneider barsoap at web.de
Sun May 11 15:30:57 EDT 2008


"Chaddaï Fouché" <chaddai.fouche at gmail.com> wrote:

> 2008/5/11 Achim Schneider <barsoap at web.de>:
> >  Excuse my bluntness, but I utterly fail to make sense of this.
> >  Reformulating your understanding of it would surely be beneficial.
> 
> He has a routine that gives him a list of words classified by line,
> and he want the hyphens to be accounted for.
> So that :
> "Hello mis-
> ter world !"
> gives [(1,["Hello","mister"]),(2,["world","!"])]
> 
Well, that's either a relatively complex hand-written recursion, or you
map a predicate that tests for hyphens over the list and zip it with the
original, offset by one, and then map it all into the result.

-- 
(c) this sig last receiving data processing entity. Inspect headers for
past copyright information. All rights reserved. Unauthorised copying,
hiring, renting, public performance and/or broadcasting of this
signature prohibited. 



More information about the Haskell-Cafe mailing list