Skip to content

Instantly share code, notes, and snippets.

View tbidne's full-sized avatar

Tommy Bidne tbidne

View GitHub Profile
@tbidne
tbidne / Optics.Inference.hs
Created October 7, 2022 02:07
Optics type inference example
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedLabels #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE UndecidableInstances #-}
module Optics.Inference where
import Optics.Core (A_Lens, LabelOptic (labelOptic), lens, set)
@tbidne
tbidne / Main.hs
Created November 2, 2021 07:35
JsonCompare
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE ImportQualifiedPost #-}
{-# LANGUAGE TemplateHaskell #-}
module Main (main) where
import Control.Applicative (liftA2)
import Data.Aeson (Options (..), defaultOptions, eitherDecode')
import Data.Aeson.TH (deriveJSON)
import Data.ByteString.Internal qualified as BS