reverse function application

Hal Daume III hdaume@ISI.EDU
Wed, 29 May 2002 15:27:48 -0700 (PDT)


i have a function:

 (*==)  :: B -> (C -> IO a) -> IO a

basically, it takes b, does something to it to make c, performs the action
on c and returns the value.

the Bs are basically Doubles, so we'll consider them as such for now.

suppose I want to string together a bunch of these things...i can write:

5 *== \x -> 6 *== \y -> somefunctiononxandy x y

but i'd really like to be able to write:

5 *== 6 *== somefunctiononxandy

or, secondarily

5 *== (6 *== somefunctiononxandy)

but i can't seem to get this to work and my brain is beginning to hurt.

i suppose this is basically the same as wanting to write something like:

action1 >>= action2 >>= somefunction

instead of

action1 >>= \x -> action2 >>= \y -> somefunction x y

so if it can be done for >>=, i can make it to work.

any advice?

 - Hal

--
Hal Daume III

 "Computer science is no more about computers    | hdaume@isi.edu
  than astronomy is about telescopes." -Dijkstra | www.isi.edu/~hdaume