Skip to content

Instantly share code, notes, and snippets.

{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE ScopedTypeVariables #-}
import Prelude hiding (log)
import Control.Concurrent
import Control.Exception
import Control.Monad
-- This gist provides a function to serialize JSON with indentation. It uses the type's
-- toEncoding implementation, meaning it follows the property order defined by the type
-- when ToJSON is implemented with genericToEncoding.
--
-- See below for an example and license information.
--
{-# LANGUAGE DerivingVia #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NoFieldSelectors #-}
{-# LANGUAGE OverloadedRecordDot #-}