[Haskell-cafe] Generalizing takeWhile
tphyahoo at gmail.com
Wed Jul 22 14:14:55 EDT 2009
What is the use case(s) for this function?
lements from the front of a list. However the
> criteria are somewhat complex.
>> walk f  = 
>> walk f (x:xs) = case f x
>> of Just g -> x : walk g xs
>> Nothing -> 
> For each item the `predicate' f either returns Nothing, when it thinks
> we should not take any more elements, or return Just another
> `predicate' to apply to the next element.
> However the type system does not like my function. How can I mollify it?
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
More information about the Haskell-Cafe