Skip to content

Instantly share code, notes, and snippets.

@k0001
Last active September 25, 2015 19:32
Show Gist options
  • Save k0001/607900b3ef7b183225ef to your computer and use it in GitHub Desktop.
Save k0001/607900b3ef7b183225ef to your computer and use it in GitHub Desktop.
-- | Add a prefix and a suffix to a given monoid. Problem: which of the arguments is which?
surround :: (Monoid a) => a -> a -> a -> a
-- | Add a prefix and a suffix to a given monoid. No problem!
surround :: (Monoid a, prefix ~ a, suffix ~ a) => prefix -> suffix -> a -> a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment