Skip to content

Instantly share code, notes, and snippets.

@jchannon
Created April 6, 2020 18:12
Show Gist options
  • Save jchannon/b65e412da5eb44bb8ac89b1c37cfc5fc to your computer and use it in GitHub Desktop.
Save jchannon/b65e412da5eb44bb8ac89b1c37cfc5fc to your computer and use it in GitHub Desktop.
type LogLevel =
| Error
| Warning
| Info
let log (level:LogLevel) message = // LogLevel -> string -> unit
printfn "[%A]: %s" level message
()
log Error "Curried function"
let logError = log Error
logError "Partially Applied function" //This isn't currying it's just that the compiler knows how to assign a function to a variable that calls another function without all arguments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment