One approach to programming in Haskell, which I use all the time, is to write
the type signature before the function body. This means that if I'm trying to do
something strange, I will often be warned by the type checker even before I've
written the strange code.
But I've also been bitten by
On Thu, 3 Jan 2008, Peter Verswyvelen wrote:
I believe type signatures are the very essence of Haskell documentation!
I'd much rather see a program with type signatures for functions and
little (or no) comments over programs with no type signatures and
ambigious comments (if any comments
Types cannot always be derived automatically, especially when coming to
Haskell extensions. Sometimes you also want to restrict the type. E.g. for
asTypeOf _ y = y
you explicitly want the type
asTypeOf :: a - a - a
not the automatically derived one:
asTypeOf :: b - a - a
Yes, sometimes it
On Jan 4, 2008 4:19 PM, Peter Verswyvelen [EMAIL PROTECTED] wrote:
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 :)
Haddock allows you to put documentation inside
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 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 -}
Nice. Still using first parameter though ;-)
On Jan 4, 2008 5:52 PM, Peter Verswyvelen [EMAIL PROTECTED] wrote:
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
On Fri, 4 Jan 2008, Peter Verswyvelen wrote:
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 -}
Nice.
Nice. Still using first parameter though ;-)
This was the problem I mentioned earlier.
I tend to write comments like
{- | @asTypeOf x y@ returns the value of @x@, while the types of @x@ and
@y@ are unified -}
asTypeOf :: a - a - a
This way I can introduce parameter names for the reader.
Hi Peter,
Is any work being done on Haskell refactoring support, like HaRe or others?
HaRe is still very active and is due for a new release very soon.
There are probably in excess of 40 refactorings for HaRe in total now, and
I intend to add more! Sadly, I am currently the only maintainer left
Hi
PS: IMHO I don't think text should be the source format of our files… I
think we should use a standarized decorated AST as the source, from which we
can derive a textual (but also graphical) view and editor… Any comments on
that? J
Yes - I think you're wrong. I've seen non-textual editors
HaRe works with both Emacs and VIM; you can also use it from a command
prompt meaning that it can be integrated into any tool that you require.
Indeed, there was even some investigation of porting it to Sub Etha Edit
with great success!
Cool! I'll check it out. However, I'm using some GHC
Cool! I'll check it out. However, I'm using some GHC extensions, so that
is
indeed a show stopper :)
Which extensions are you using that are not Haskell 98? I would be very
interested to know what users would generally require from a refactorer.
You mean a syntax-directed editor, right?
Yes - I think you're wrong. I've seen non-textual editors for
programming languages, and they are severely unpleasant for all but
the most new beginners and restricted tasks.
For programmers and mathematicians, you are absolutely right. For beginners
and people who have highly developed visual
I agree with Neil, AST editors are generally ugly and hard to use. There
is also the problem of laying out Haskell code. Everyone uses their own
layout style and pretty printing ASTs is generally a bad thing to do in
this context.
I actually meant something more like
Hello Peter,
Thursday, January 3, 2008, 9:13:27 PM, you wrote:
well, i use refactoring without help of any tool. according to my
own experience, it's much easier in Haskell than in other languages i
know - basically, you just cut-n-paste your code around. i don't use
type signatures at all -
Hi Bulat,
i don't use
type signatures at all - this creates some problems when i wrote large
portion of code and try to make it compile, but nothing more
I believe type signatures are the very essence of Haskell documentation!
I'd much rather see a program with type signatures for functions
Currently, I'm trying to learn arrows and Yampa (mainly to see how well it
compares to my own dataflow/reactive stuff that was written in C#, C++ and
assembler)
Arrows won't work with HaRe at the moment, therefore Yampa won't either;
which is a shame.
First of all, let's see if I get the
Furthermore, IMHO, type signatures alone are not enough, a good parameter
name says at least as much as the type.
Yes! A very good point! :)
E.g. what does a function Int - Int - Bool do? I have no idea. A good
function name helps, e.g. isDivisible:: Int - Int - Bool. But then I still
I believe type signatures are the very essence of Haskell documentation!
I'd much rather see a program with type signatures for functions and
little (or no) comments over programs with no type signatures and
ambigious comments (if any comments at all!).
Okay, but when using a syntax directed
Furthermore, when I need to perform refactoring, a rename is
just *one* change to the entire system, no matter how many other files
use
the name; no more merging for stupid renames.
I'm a little confused as to what you mean here. A renaming renames all
(and only those) uses of an identifier
On Thu, 03 Jan 2008 19:48:05 +0100, C.M.Brown [EMAIL PROTECTED] wrote:
HaRe is still very active and is due for a new release very soon.
There are probably in excess of 40 refactorings for HaRe in total now,
and
I intend to add more! Sadly, I am currently the only maintainer left
on the
G'day all.
Quoting Peter Verswyvelen [EMAIL PROTECTED]:
I actually meant something more like
http://en.wikipedia.org/wiki/Intentional_programming
I'm pretty sure that Intentional programming is Hungarian for I want
to sell you another IDE.
Cheers,
Andrew Bromage
Hi,
A possible first goal would be, to add extensions that are definitely in
Haskell prime, see:
http://hackage.haskell.org/trac/haskell-prime/wiki/Status'#definitely-inProposalStatus
Oh great! Thanks for the link, I think the main issue is moving over to a
platform that is heavily
24 matches
Mail list logo