Skip to content

Instantly share code, notes, and snippets.

@forketyfork
Created May 11, 2021 07:06
Show Gist options
  • Save forketyfork/0d7446429cd9a5edbd1f3c768561cce9 to your computer and use it in GitHub Desktop.
Save forketyfork/0d7446429cd9a5edbd1f3c768561cce9 to your computer and use it in GitHub Desktop.
Code to article "Why You Should Learn Functional Programming: Type Classes vs. Interfaces"
getSum ( Sum 1 `mappend` Sum 2 ) -- this returns 3
getProduct ( Product 5 `mappend` Product 10 ) -- this returns 50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment