Created
May 8, 2019 17:48
-
-
Save dmwit/8391b0e4f0a92a128ae729c466e26a46 to your computer and use it in GitHub Desktop.
maybe a way to use generic-deriving
This file contains hidden or 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 DeriveAnyClass #-} | |
{-# LANGUAGE DeriveGeneric #-} | |
import Generics.Deriving.Monoid | |
import Generics.Deriving.Semigroup | |
import GHC.Generics | |
data Foo = Foo () deriving (Generic, GSemigroup, GMonoid) | |
instance Semigroup Foo where (<>) = gsappend | |
instance Monoid Foo where mempty = gmempty |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment