On 22/02/2011, at 7:46 PM, z_axis wrote:

> 
> I want to split "2,15,33,0,8,1,16,18" to ([2,15,33],[8,1,16,18]).  the "0"
> will by discarded.
> 
> However, it seems that there isnot any standard function to do it.

let (front,(_:back)) = List.span (/= 0) xs in (front,back)

What do you plan to do if there is no 0 there?

[Yes, I know this can be done in point free style.  I hereby announce
defeat in code golf.]


_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to