Thanks for the library!
I was looking for something like sepBy but requiring an exact number of separated elements.
If it's not here yet, maybe it could be added:
sepByN :: Alternative m => m a -> m sep -> Int -> m [a]
sepByN x sep n = (:) <$> x <*> count (n-1) (sep *> x)
It can be used in this "semantic" way:
Thanks for the library!
I was looking for something like sepBy but requiring an exact number of separated elements.
If it's not here yet, maybe it could be added:
It can be used in this "semantic" way: