currying? #1

Open
dominictarr opened this Issue Apr 18, 2012 · 2 comments

Comments

Projects
None yet
2 participants
@dominictarr

what about functions that take more than one argument?

can you still find cases like:

  var _m = c(Y)
  a(b(_m), d(_m)))

or have I misunderstood something?

@substack

This comment has been minimized.

Show comment
Hide comment
@substack

substack Apr 18, 2012

Owner

Functions that take more than 1 argument can be decomposed into multiple curried functions of a single argument. I want to transform input automatically for this. Harder to add is allowing function arguments to functions and also solving for composition under those function arguments too.

Owner

substack commented Apr 18, 2012

Functions that take more than 1 argument can be decomposed into multiple curried functions of a single argument. I want to transform input automatically for this. Harder to add is allowing function arguments to functions and also solving for composition under those function arguments too.

@dominictarr

This comment has been minimized.

Show comment
Hide comment
@dominictarr

dominictarr Apr 19, 2012

ah yes, that is why haskell represents the type of a function as

a -> b -> c 

it can just trivially curried to be a function that takes a and returns another function with sig b -> c

thinking about this, if you have a function that take an argument ( b -> c ) then you could curry a -> b -> c
and pass that to it. so then you could compose

a -> b -> c with ( b -> c) -> d correct?

what about cases where you have

a -> b, a -> c, and b -> c -> d

clearly that is composable too.

ah yes, that is why haskell represents the type of a function as

a -> b -> c 

it can just trivially curried to be a function that takes a and returns another function with sig b -> c

thinking about this, if you have a function that take an argument ( b -> c ) then you could curry a -> b -> c
and pass that to it. so then you could compose

a -> b -> c with ( b -> c) -> d correct?

what about cases where you have

a -> b, a -> c, and b -> c -> d

clearly that is composable too.

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