Skip to content

Parse ADT from haskell in a quick and dirty way

License

Notifications You must be signed in to change notification settings

lddllddl/readADT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

readADT

Parse ADT from Haskell in a quick and dirty way.

Most Haskell data types implement a Show class (that is, you would be able to print it). In most cases, but not certainly, the printed string contains all information necessary to reconstruct the actual value. Often the code you have at hand may have the Show class implemented but not other typeclasses for serialization or interoperability.

This short script reads the typical Shown string representation into Python values (and hence JSON) so that you can process it out of Haskell in a pinch, without implementing additional typeclasses for serialization. Feed a single printed ADT into stdin, to receive a JSON value at stdout.

The only extra dependency is the parsy library.

About

Parse ADT from haskell in a quick and dirty way

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages