Hi Tillmann,
That's worked a treat -- thanks ever so much :)
Will
On Wed, Aug 11, 2010 at 7:50 PM, Tillmann Rendel
ren...@mathematik.uni-marburg.de wrote:
Will Jones wrote:
f :: Int - IO ()
f = undefined
g :: Int - Int - IO ()
g = undefined
h :: Int - Int - Int - IO ()
h
There's no (safe) way to go from
a - IO b
to
IO (a - b)
which is part of what vtuple does.
Consider
foo :: Int - IO String
foo 0 = return zero
foo _ = launchMissles return fired!
How would you implement foo2 :: IO (Int - String) with the same behavior?
You can't; you would somehow need to
Hi Ryan,
Thanks for the reply. The specification I've given is just to illustrate the
kind of relationship I'm trying to establish between the types of the
argument and the result. In reality the type of the argument function is
something a little more usable; you could generalise it with type
Hello Will,
2010/8/11 Will Jones w...@sacharissa.co.uk:
I'm trying to write a function (I'll call it `vtuple' for lack of a better
name)
that returns a function that itself returns multiple arguments in the form
of a
tuple. For example:
vtuple f :: IO (Int - (Int, ()))
vtuple g :: IO (Int
Will Jones wrote:
f :: Int - IO ()
f = undefined
g :: Int - Int - IO ()
g = undefined
h :: Int - Int - Int - IO ()
h = undefined
vtuple f :: IO (Int - (Int, ()))
vtuple g :: IO (Int - Int - (Int, (Int, (
I've tried to type vtuple using a type class; [...]
I've thought about