Last active
August 11, 2018 11:00
-
-
Save waddlaw/74034869a490e5821cfb5cae65faa31f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# 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))] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# 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