- Write a function that takes an argument and returns that argument.
- Write two binary functions,
add
andmul
, that take two numbers and return their sum and product. - Write a function that takes an argument and returns a function that returns that argument.
- Write a function that adds from two invocations.
- Write a function that takes a binary function, and makes it callable with two invocations.
- Write a function that takes a function and an argument, and returns a function that can supply a second argument.
- Without writing any new functions, show three ways to create the
inc
function. Using functions from the previous six problems. - Write
methodize
, a function that converts a binary function to a method. - Write
demethodize
, a function that converts a method into a binary function. - Write a function
twice
that takes a binary function and returns a unary function, that passes it's argument to the binary function twice. - Write a function
composeu
that takes two unary functions and returns a unary function that calls them both. - Write a function
composeb
thst takes two binary functions and returns a function that calls them both. - Write a function that allows another function to be only called once.
- Write a factory function that returns two functions that implement an up/down counter.
- Make a revocable function that takes a nice function and returns a
revoke
function that denies access to the nice function, and aninvoke
function that can invoke the nice function until it is revoked.
-
Notifications
You must be signed in to change notification settings - Fork 0
nglasantha/funFunction
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published