Formatierer & Code
JSON zu Haskell-Datentyp
Haskell records with FromJSON / ToJSON instances.
Anmerkung der Redaktion
Understanding · Records, deriving, and FromJSON.
Dieses ausführliche Kapitel ist derzeit nur auf Englisch verfügbar. Das Konvertierungstool oben funktioniert in Ihrer Sprache; der lange Erklärtext wurde noch nicht übersetzt.
Häufig gestellte Fragen
Quick answers.
›Which Haskell libraries are supported?
The generator focuses on the `Aeson` library, producing `FromJSON` and `ToJSON` instances compatible with modern Haskell development.
›How does it handle nested objects?
Nested JSON objects are converted into separate Haskell data types, with the parent record referencing these types as fields.
›Are Haskell naming conventions followed?
Yes. The tool converts snake_case or camelCase JSON keys into valid Haskell record fields, typically prepending the type name to avoid namespace collisions.
›Can I use this for complex arrays?
Arrays of objects are mapped to Haskell lists of a specific type, while mixed-type arrays may require manual adjustment into a Sum type or `Value`.
Andere suchten auch nach
Verwandte Tools
More in this room.
- JSON zu TypeScript-InterfaceTypen aus einem JSON-Beispiel ableiten und TS-Interfaces ausgeben.
- JSON zu C#-KlassePOCO-Klassen aus einem JSON-Beispiel generieren.
- JSON zu Java POJOEin Java POJO aus einem JSON-Beispiel erstellen.
- JSON zu Python DataclassTyp-hinzugefügte Dataclasses (mit optionalem Pydantic) aus JSON.
- JSON zu Go StructIdiomatische Go-Structs mit `json:` Tags.
- JSON zu Kotlin Data ClassPrägnante Data Classes für jedes JSON-Beispiel.