[Haskell-cafe] Build regressions due to GHC 7.6
mgsloan at gmail.com
Thu Aug 30 21:16:39 CEST 2012
A good way to specify such refactorings is as a Haskell module. For example:
module PreludePre_7_6 where
import Prelude hiding ( catch )
Or, an example of avoiding the Eq / Show / Num debacle:
module PreludePre_7_4 (module Prelude, Num) where
import Prelude hiding ( Num )
import qualified Prelude as P
instance template (Eq a, Show a) => Num a where
instance P.Num a
(Uses my instance template proposal - though with different keywords -
Let's say we wanted to rename "catch" to "unsafeCatch"
module PreludePreUnsafeCatch (module Prelude, catch) where
import Prelude hiding (unsafeCatch)
catch = unsafeCatch
Then, an automated refactoring system is "simply" a sourcecode-based
module inliner. Quite a bit of effort, certainly, but it's much
better than coming up with a whole new notation for refactorings.
On Thu, Aug 30, 2012 at 6:34 AM, Alexander Bernauer
<alex-haskell at copton.net> wrote:
> I agree that automatic code migration can solve this issue in large
> parts. The Python folks have done this to mitigate the transition from
> version 2 to version 3 .
> On Thu, Aug 30, 2012 at 03:03:05PM +0200, Alexander Kjeldaas wrote:
>> perl -ni -e 'print unless /import Prelude hiding \(catch\)/' $(git grep
>> 'import Prelude hiding (catch)')
> I don't think regular expressions are powerful enough. This example
> does not match on hiding multiple names, for instance.
> But writing proper 'HsModule -> HsModule' functions should be doable.
> And when each release comes with a bunch of such functions, packages
> could be automatically migrated.
>  http://docs.python.org/library/2to3.html
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
> -----END PGP SIGNATURE-----
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
More information about the Haskell-Cafe