Skip to content

Instantly share code, notes, and snippets.

@waddlaw
Last active August 11, 2018 11:00
Show Gist options
  • Save waddlaw/74034869a490e5821cfb5cae65faa31f to your computer and use it in GitHub Desktop.
Save waddlaw/74034869a490e5821cfb5cae65faa31f to your computer and use it in GitHub Desktop.
{-# LANGUAGE TemplateHaskell #-}
module Ins where
import Language.Haskell.TH
import Language.Haskell.TH.Syntax
standAloneDerivingShow :: Name -> DecsQ
standAloneDerivingShow n = return [StandaloneDerivD Nothing [] (AppT (ConT ''Show) (ConT n))]
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE StandaloneDeriving #-}
module Lib where
import Ins
data A = A
standAloneDerivingShow ''A
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment