<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Fri, Jul 3, 2015 at 8:24 PM Francesco Ariis <<a href="mailto:fa-ml@ariis.it">fa-ml@ariis.it</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Fri, Jul 03, 2015 at 11:26:03PM +0000, Mike Meyer wrote:<br>
> Ok,I've looked at the packages google and hackage found (ini, hsini &<br>
> ConfigFile), and can't use any of them for dealing with the ini files I'm<br>
> being handed.<br>
><br>
> The problem is they all parse the config file into Maps, and that doesn't<br>
> seem to be an option. I need lists, because I have multiple sections with<br>
> the same name that turn into a list of objects, as well as sections that<br>
> can have multiple options with the same name that turn into multiple<br>
> objects.<br>
><br>
> Any chance I overlooked a parser? Or maybe some parsing options in<br>
> ConfigFile?<br>
><br>
> Any other advice on a library to do this?<br>
<br>
Hello Mike,<br>
    I am pretty sure multiple options with the same name are illegal or<br>
undefined behaviour in .ini files, so I wouldn't bet on any of the<br>
libraries supporting that.<br></blockquote><div><br></div><div>Is there a standard, specification or even some MS document that defines what is and is not legal? I couldn't find one. Nor do I know of any system that uses them for data interchange. Mostly they seem to be read & written solely by the program that uses them for configuration info, and edited by hand, so whatever the program accepts is legal.</div><div><br></div><div>That's the case for the ones I'm dealing with. Since changing the program format - at least not without writing a converter - isn't an option, even having an ISO standard wouldn't matter. I've gotta deal with what we have, one way or another.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Have you thought writing your own little Parsec parser? Probably not<br>
the answer you were wishing for, but you could cannibalise this weirdly<br>
written .ini parser [1] and change the upper level functions to suit<br>
your needs.<br></blockquote><div><br></div><div>Was there a link in there? I didn't see one. And yes, I've thought of writing my own parser for it. I figured I'd make one last check for a library before doing that.</div><div><br></div><div>Thanks,</div><div>Mike</div></div></div>