Is in ocaml function which can parse string like this "[(1,2,3);(1,2,5);(2,3,4)]" into (int*int*int) list ? or do I have to write my own parsing function ?
Thanks
Greg
Well, it should not be too difficult with help of the Scanf module from the standard library -- you will be able to scan the triples easily and then only have to add a bit of logic to parse a list.
Alternatively you can take a look at deriving:
Extension to OCaml for deriving functions from type declarations. Includes derivers for pretty-printing, type-safe marshalling with structure-sharing, dynamic typing, equality, and more.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With