Authors
-
This snippet calculates the objects to iterator over and the constructor index to use. There's a bit a hand waving there: for objects we will take the first construtor we defined (I'll implement multiple constructor support later), and the JSON values it contains in the map. We just ensure we get the values in the order the fields are defined (given by the constrFields function). For number we use the int constructor if our result type looks like an int, otherwise we use the float constructor. T (Read Full Article)
Related Articles
- Nested records headaches in Haskell
- also written by JP Moresmau
- JP Moresmau's Programming Blog: My first Haskell adventure game!
- also published in JP Moresmau's Programming Blog
- Scraping my boilerplate: Generics instead of Records
- also written by JP Moresmau
- Serializing Haskell objects to JSON
- also written by JP Moresmau
- The unintentional infinite list
- also written by JP Moresmau
- instance Data Map where -- half done!
- also written by JP Moresmau
- Haskell syntax is not Java syntax; good or bad?
- also written by JP Moresmau
- Handling errors in JSON to Haskell deserialization
- also written by JP Moresmau





