Skip to content

Instantly share code, notes, and snippets.

@deepak
Last active September 29, 2016 09:56
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 deepak/ed5e3c99a889c78a247ca60cd5581d56 to your computer and use it in GitHub Desktop.
Save deepak/ed5e3c99a889c78a247ca60cd5581d56 to your computer and use it in GitHub Desktop.
trying elm
foo = 10
((-) foo 1)
((-) 1 foo)
-- derived type
-- cmd1 : a -> number
cmd1 = \op -> ((-) foo 1)
cmd1 (-1) -- 9
-- derived type.
-- do not understand how this came up ?
-- am i doing this right ?
-- expected cmd2 to be a infix version of cmd1 which is infix
-- cmd2 : (number -> number' -> a) -> a
cmd2 = \op -> (1 `op` foo)
-- does not work
-- TYPE MISMATCH --------------------------------------------- repl-temp-000.elm
-- You are giving 2 arguments to something that is not a function!
-- 5| 1 op foo)
-- ^^^^^^
-- Maybe you forgot some parentheses? Or a comma?
-- cmd3 = \op -> (1 op foo)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment