[Haskell-cafe] Refactoring status

Henning Thielemann lemming at henning-thielemann.de
Fri Jan 4 14:37:53 EST 2008

On Fri, 4 Jan 2008, Peter Verswyvelen wrote:

> Yes, sometimes it is neccerary to give an explicit type. But in so many
> cases, type inference works fine no? What I usually do, is use the GHCi t:
> command, copy/paste that in my code, and then make the type signature more
> specific if it has to be. It's often funny to see how generic the code
> really is :)


> > It's a problem in Haskell that there are no unique parameter names, due to
> > pattern matching.
> Yes, but it would be nice to attach some "parameter-comment" to the types
> no? Now a lot of documentation is written in the style "the 7th parameter
> is...". Not very user friendly :)

It's already possible to write

asTypeOf ::
     a   {- ^ the input value to be passed through -}
  -> a   {- ^ the value is ignored, but the type is unified with the first parameter -}
  -> a   {- ^ the value of the first parameter -}

More information about the Haskell-Cafe mailing list