フォーマッター&コード
JSONからHaskellデータ型へ
Haskell records with FromJSON / ToJSON instances.
Runs in your browser
編集者注
Understanding · Records, deriving, and FromJSON.
この詳細な解説章は現在、英語版のみで提供されています。上の変換ツールはあなたの言語で動作しますが、長文の解説記事はまだ翻訳されていません。
よくある質問
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`.
他の人はこちらも検索しています
関連ツール
More in this room.
- JSON to TypeScript InterfaceJSONサンプルから型を推測し、TSインターフェースを出力します。
- JSON to C# ClassJSONサンプルからPOCOクラスを生成します。
- JSON to Java POJOJSONサンプルからJava POJOを出力します。
- JSON to Python DataclassJSONから型ヒント付きのdataclass(オプションでPydantic)を生成します。
- JSON to Go Structjson:`タグ`付きのGoらしいstructを生成します。
- JSON to Kotlin Data Class任意のJSONサンプルに対応する簡潔なデータクラスを生成します。