Skip to content

Instantly share code, notes, and snippets.

@nkpart
Created January 23, 2018 02:12
Show Gist options
  • Save nkpart/2931b896282f8630bd20aa350bd3e237 to your computer and use it in GitHub Desktop.
Save nkpart/2931b896282f8630bd20aa350bd3e237 to your computer and use it in GitHub Desktop.
Prelude> :set -XDerivingStrategies
Prelude> :set -XGeneralizedNewtypeDeriving
Prelude> newtype Foo = Foo Int deriving newtype Show
Prelude> Foo 3
3
Prelude> newtype BFoo = BFoo Int deriving Show
Prelude> BFoo 3
BFoo 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment