Skip to content

Instantly share code, notes, and snippets.

@dmwit
Created May 8, 2019 17:48
Show Gist options
  • Save dmwit/8391b0e4f0a92a128ae729c466e26a46 to your computer and use it in GitHub Desktop.
Save dmwit/8391b0e4f0a92a128ae729c466e26a46 to your computer and use it in GitHub Desktop.
maybe a way to use generic-deriving
{-# 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