[Haskell-cafe] list of range

Henning Thielemann lemming at henning-thielemann.de
Mon Oct 4 16:02:19 UTC 2021


On Mon, 4 Oct 2021, PICCA Frederic-Emmanuel wrote:

> Hello, I need to parse a commande line which allows user to describe indices like this
>
> 1             -> only one indice
> 1-5          -> [1..5]
> 1-5 6-10  ...-> [1..5] ++ [6..10]
>
> My question is what it the best type in order to store this information ?

Is it necessary to preserve the structure of separate ranges or would it 
be ok to just store [Int] or Set Int?


More information about the Haskell-Cafe mailing list