Skip to content

Instantly share code, notes, and snippets.

@MelkorNemesis
Created January 6, 2021 20:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MelkorNemesis/b53535f298d478aa437853c8180dbbd9 to your computer and use it in GitHub Desktop.
Save MelkorNemesis/b53535f298d478aa437853c8180dbbd9 to your computer and use it in GitHub Desktop.
1. From https://gist.github.com/MelkorNemesis/1a46a868c508ee5b0e37eafabda3fedc
instance Monoid b => Monoid (a -> b) where
mappend f g x = f x `mappend` g x
------------------------------------------
2. From https://hackage.haskell.org/package/base-4.14.1.0/docs/src/GHC.Base.html#Semigroup
instance Semigroup b => Semigroup (a -> b) where
f <> g = \x -> f x <> g x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment