"Frank A. Christoph" wrote:
>
> > Here is a laundry list of things I think Haskell still needs. By
> > Haskell here I mean Haskell plus extension that are found in both hugs
> > and ghc.
> ...
> > 4) Being able to write
> > do a <- getLine
> > b <- getLine
> > proc a b
> > as
> > proc getLine getLine
> > and the like. I don't know the number of times that I get REALLY sick
> > of having to explicitly bind everything to a variable. Monads do a very
> > good job of supporting imperative style. Now lets make them less
> > tedious to use.
>
> You could define proc':
>
> proc' act1 act2 = do
> v1 <- act1
> v2 <- act2
> proc v1 v2
>
> so you can write:
>
> proc' getLine getLine
I know.
> When proc returns a value rather than a computation, i.e., proc :: a -> b ->
> c, and c is not monadic, then you can just write Monad.liftM2 proc getLine
> getLine.
>
> You could define a higher-order version of proc' above in the same vein:
>
> liftM2' :: (a -> b -> m c) -> (m a -> m b -> m c)
> liftM2' proc m1 m2 = do
> v1 <- m1
> v2 <- m2
> proc v1 v2
Yes I also know.
>
> In simpler cases where proc takes only one argument, you can avoid thinking
> up new names by currying:
>
> getLine >>= proc
Yes I also know.
>
> I find that if you make liberal use of higher-order constructs and
> modularize your code, then the need to do explicit binding is not so much of
> a problem. Then again, I am the sort of person who uses "let" and "where"
> whenever he can to name subexpressions as well...
But the point is I would like the type system to AUTOMATICALLY do this
for me so that I don't have to memorize/lookup a bunch of higher order
functions. True ONCE you know them all they are not difficult to use
but to a new programmer all these (seemly unnecessary) high functions
can make doing the simplest task quite difficult. So the new programmer
will just use the do....
This is why I belive in true adhoc overloading.
1) so that you don't have to make up names just reuse the old ones
2) make using standard library functions easier to use because there
will be a lot fewer names to lookup/memorize.
--
Kevin Atkinson
[EMAIL PROTECTED]
http://metalab.unc.edu/kevina/