[EMAIL PROTECTED]  writes


> Is it possible to define an inverse function such that given the functions
> f,g, and h and their inverses f',g', and h', the inverse function would
> return the appropriate inverse?
> e.g.
> inverse(f)=f'
> inverse(g)=g'
> inverse(h)=h'


Looks strange. But let us try an example:

  inverse :: (Int -> Int) -> (Int -> Int)
  inverse    f            =  case  f 0  of  n -> (\x-> x - n)  

Then, for example,  let  { f x = x+1;  g x = x+2 }  
                    in   
                    (inverse f, inverse g)

would produce the functions  f',g'  which are the inverse for these
f, g.
Will this do?

And if you meant recognizing (before inversion) the equality of 
some  h  to mathematical maps defined by arbitrary programs  f, g,
then this is very different, and in some sense, impossible.


------------------
Sergey Mechveliani
[EMAIL PROTECTED]

Reply via email to