binary icon indicating copy to clipboard operation
binary copied to clipboard

listUntilEnd

Open singpolyma opened this issue 12 years ago • 1 comments

I often find myself needing this function:

listUntilEnd :: (Binary a) => Get [a]
listUntilEnd = do
   done <- isEmpty
   if done then return [] else do
      next <- get
      rest <- listUntilEnd
      return (next:rest)

singpolyma avatar Apr 20 '13 17:04 singpolyma

+1. I needed such function on many occasions as well. It's especially useful in conjuction with isolate

Shimuuar avatar May 21 '13 15:05 Shimuuar