Skip to content

Instantly share code, notes, and snippets.

@mwotton
Created January 22, 2013 04:11
Show Gist options
  • Save mwotton/4591985 to your computer and use it in GitHub Desktop.
Save mwotton/4591985 to your computer and use it in GitHub Desktop.
module Foo where
data FooArgs = FooArgs { foo :: String,
baz :: Integer }
fooer :: FooArgs -> String
fooer = undefined -- doesn't really matter what it does
-- missingArg = fooer (FooArgs { foo = "abc" })
-- legit = fooer (FooArgs { foo = "abc", baz = 12 })
@mwotton
Copy link
Author

mwotton commented Jan 22, 2013

*Foo> let missingArg = fooer (FooArgs { foo = "abc" })

:4:25:
Warning: Fields of FooArgs' not initialised: baz In the first argument offooer', namely (FooArgs {foo = "abc"})' In the expression: fooer (FooArgs {foo = "abc"}) In an equation formissingArg':
missingArg = fooer (FooArgs {foo = "abc"})
*Foo> let legit = fooer (FooArgs { foo = "abc", baz = 12 })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment