Bah, the first, looping one of those, which corresponds to the original problem program, should have been
list1 ls = let (good, other) = break ("{-" `isPrefixOf`) ls (bad, rest) = break ("-}" `isSuffixOf`) other in good ++ list1 (drop 1 rest) On Sunday, December 13, 2015 at 2:56:42 PM UTC-5, Michael Thompson wrote: > > Oh, I meant to devise a Data.List equivalent of the problem. The first of > these loops unproductively for the same reason. > > list1 ls = > let (good, other) = break ("{-" `isPrefixOf`) ls > (bad, rest) = break ("{-" `isPrefixOf`) other > in good ++ list1 rest > > list2 ls = > let (good, other) = break ("{-" `isPrefixOf`) ls > (bad, rest) = break ("-}" `isSuffixOf`) other > in case rest of > [] -> good > x:xs -> good ++ list2 xs > > > -- You received this message because you are subscribed to the Google Groups "Haskell Pipes" group. To unsubscribe from this group and stop receiving emails from it, send an email to haskell-pipes+unsubscr...@googlegroups.com. To post to this group, send email to haskell-pipes@googlegroups.com.