darcs patch: Convert an accented surname in a comment... (and 5 more)

6 patches for repository http://code.haskell.org/c2hs: Mon Nov 8 23:46:25 GMT 2010 will@willthompson.co.uk * Convert an accented surname in a comment to UTF-8 hasktags makes the (reasonable) assumption that source files are UTF-8, and gets very upset if they're not. Tue Nov 9 06:02:13 GMT 2010 will@willthompson.co.uk * Fix generation of superclass instances Previously, specifying a superclass in a {# class #} rule would generate incorrect code. For instance, the 'pointer' test case includes the following:
{#pointer *Point as APoint newtype#} {#class APointClass APoint#}
{#pointer *ColourPoint as AColourPoint newtype#} {#class APointClass => AColourPointClass AColourPoint#}
This generates an incorrect instance of APointClass for AColourPoint, as follows:
instance APointClass AColourPoint where aColourPoint (AColourPoint p) = AColourPoint (castPtr p) fromAColourPoint (AColourPoint p) = AColourPoint (castPtr p)
This was due to the code generator using the name of the type being defined rather than the name of the superclass type, which was due to a missing apostrophe. This is my favourite kind of bug fix. Tue Nov 9 06:13:26 GMT 2010 will@willthompson.co.uk * Split collecting superclasses out of a where clause This would have prevented the bug I just fixed, since the mistaken type identifier would not have been in scope. Tue Nov 9 06:16:37 GMT 2010 will@willthompson.co.uk * Simplify generating class cast instances Tue Nov 9 16:37:47 GMT 2010 will@willthompson.co.uk * Squash an unused result warning Tue Nov 9 17:49:46 GMT 2010 will@willthompson.co.uk * Fix deprecation warnings and build trivia in test suite The test suite was passing -fffi to GHC; this patch adds LANGUAGE ForeignFunctionInterface to the relevant files instead. The test suite also used the deprecated C2HS module for converting between Int and CInt; this patch fixes all tests that were using these functions. Also, the Sizeof test didn't compile. It now compiles, but still fails due to bug #10. Finally, compilation errors would previously not cause `make` to fail in some cases.

On 12 November 2010 12:32,
6 patches for repository http://code.haskell.org/c2hs:
Cool, thanks for all this!
Mon Nov 8 23:46:25 GMT 2010 will@willthompson.co.uk * Convert an accented surname in a comment to UTF-8
hasktags makes the (reasonable) assumption that source files are UTF-8, and gets very upset if they're not.
Aye. GHC doesn't bother decoding comments so we miss these :-(
Tue Nov 9 06:02:13 GMT 2010 will@willthompson.co.uk * Fix generation of superclass instances
Previously, specifying a superclass in a {# class #} rule would generate incorrect code. For instance, the 'pointer' test case includes the following:
> {#pointer *Point as APoint newtype#} > {#class APointClass APoint#} > > {#pointer *ColourPoint as AColourPoint newtype#} > {#class APointClass => AColourPointClass AColourPoint#}
This generates an incorrect instance of APointClass for AColourPoint, as follows:
> instance APointClass AColourPoint where > aColourPoint (AColourPoint p) = AColourPoint (castPtr p) > fromAColourPoint (AColourPoint p) = AColourPoint (castPtr p)
This was due to the code generator using the name of the type being defined rather than the name of the superclass type, which was due to a missing apostrophe. This is my favourite kind of bug fix.
Ok, so you're saying that nobody could possibly have been using this feature because it plainly does not work? So it's safe to change the behaviour without doing a major version bump? Duncan

On 12/11/10 18:10, Duncan Coutts wrote:
Ok, so you're saying that nobody could possibly have been using this feature because it plainly does not work? So it's safe to change the behaviour without doing a major version bump?
Yep. With current releases, the generated code does not compile, because the functions defined in the instance aren't actually methods of the class being implemented. So this is just a bug fix, not a change in behaviour anyone could have been relying on. -- Will

On 12 November 2010 18:18, Will Thompson
On 12/11/10 18:10, Duncan Coutts wrote:
Ok, so you're saying that nobody could possibly have been using this feature because it plainly does not work? So it's safe to change the behaviour without doing a major version bump?
Yep. With current releases, the generated code does not compile, because the functions defined in the instance aren't actually methods of the class being implemented. So this is just a bug fix, not a change in behaviour anyone could have been relying on.
Ok, great, thanks. Duncan
participants (3)
-
Duncan Coutts
-
Will Thompson
-
will@willthompson.co.uk