Skip to content

Instantly share code, notes, and snippets.

@jisantuc
Last active March 7, 2021 00:42
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 jisantuc/2b3d6e1add1eebac2c351a261d93c30c to your computer and use it in GitHub Desktop.
Save jisantuc/2b3d6e1add1eebac2c351a261d93c30c to your computer and use it in GitHub Desktop.
module Main where
newtype Foo = Foo { module :: String }
-- fine but the syntax highlighter hates it
foo :: Foo
foo = Foo { module: "hi" }
-- also fine but the syntax highlighter hates it
getModule :: Foo -> String
getModule (Foo rec ) = rec.module
-- _not fine_ -- cannot destructure module field
-- getModule :: Foo -> String
-- getModule (Foo { module }) = module
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment