-
ttc
Textual Type Classes - a Haskell library for conversion between data types and textual data types
I had not come across your witch package before. Thank you very much for letting me know about it! I will add it to the related work section of the TTC README.
-
CodeRabbit
CodeRabbit: AI Code Reviews for Developers. Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.
-
The witch package provides type classes for converting between arbitrary types: text, numbers, and anything else that people create instances for. It is therefore much more broadly applicable compared to TTC, which only works with text. I really appreciate that both a From type class (for conversion without failure) and a TryFrom type class (for conversion that may fail) are used, and the implementation looks very convenient. I will remember this project and use it when I have a suitable application in the future.
-
I have done a lot of CSV development! I usually use the cassava library, though I have my own library as well. The cassava library uses FromRecord, FromNamedRecord, ToRecord, and ToNamedRecord type classes for parsing and rendering records, and it uses FromField and ToField type classes for parsing and rendering fields. An identifier type like the UserName example above should declare instances for FromField and ToField in order to be used in CSV files. For types that have appropriate Render and Parse instances, I implement general functions named something like parseFieldWithTTC and toFieldWithTTC, which allows me to declare instances as follows: