[isabelle-dev] Tweak Haskell output for future Haskell compatibility.
florian.haftmann at informatik.tu-muenchen.de
Sun May 13 10:20:03 CEST 2012
> the Haskell code generator of Isabelle currently emits contexts for
> data and newtype generates, e.g. (from CeTA):
> newtype (Linorder a) => Rbt a b = Rbt (Rbta a b);
> The sole effect of such contexts is that the programmer must provide
> a (Linorder a) context wherever Rbt a b is used, which is fairly uselss.
> In the next version of the Haskell language definition (whenever that
> will be), this feature will be removed.
> Ghc currently requires a flag (-XDatatypeContexts) to compile code
> using datatype contexts. In the latest release (7.4.1), this option
> emits a warning:
> Warning: -XDatatypeContexts is deprecated: It was widely considered a
> misfeature, and has been removed from the Haskell language.
> I propose, therefore, to omit these contexts in code generated by
> Isabelle. This can safely wait until after the release, of course.
> (patch attached)
thanks for pointing that out. Indeed, the incorporation of contexts (in
Haskell speak, in Isabelle we denote this rather as sort constraints)
for datatype constructors into the code generator is a relict of the
early days of the code generator when I approached this story
(necessarily) in a rather naive way. Since there was never a urgent
pain to remove this »feature« it remained as it is. In the next months
(i.e. before the release *after* Isabelle-2012) I will take care of this
clean it up.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 262 bytes
Desc: OpenPGP digital signature
More information about the isabelle-dev