(1) There's a mechanical way to translate FD programs with
non-overlapping instances to TF (and of course vice versa). For
example, let's reconsider Oleg's example.
{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE FlexibleContexts #-}
Comments see below.
On Wed, May 1, 2013 at 11:13 AM, AntC anthony_clay...@clear.net.nz wrote:
Martin Sulzmann martin.sulzmann@... writes:
(1) There's a mechanical way to translate FD programs with
non-overlapping instances to TF (and of course vice versa).
Martin, no! no! no! You have
Any chance to express this in terms of a formal (constraint rewrite
framework).
For example, the Haskell rule, do *not* display implied superclasses,
can be
specified as follows. Consider the special case of
class Eq a
class Eq a = Ord a
Eq a, Ord a = Ord a
The above rule only applies
Ross Paterson writes:
On Fri, May 05, 2006 at 08:42:12AM +0100, Simon Peyton-Jones wrote:
Alas, g simply discards its argument, so there are no further
constraints on 'a'. I think Martin would argue that type inference
should succeed with a=Bool, since there is exactly one solution.
Ross Paterson writes:
Thanks for clarifying this.
On Sat, Apr 29, 2006 at 05:49:16PM -0400, Manuel M T Chakravarty wrote:
So, we get the following type for f
f :: (Mul a b, [Result a b] = b) = Bool - a - b - [Result a b]
Given the instance definitions of that example, you
Manuel M T Chakravarty writes:
Martin Sulzmann:
A problem with ATs at the moment is that some terminating FD programs
result into non-terminating AT programs.
Somebody asked how to write the MonadReader class with ATs:
http://www.haskell.org//pipermail/haskell-cafe/2006-February
Ross Paterson writes:
On Thu, Apr 27, 2006 at 12:40:47PM +0800, Martin Sulzmann wrote:
Yes, FDs and ATs have the exact same problems when it comes to termination.
The difference is that ATs impose a dynamic check (the occurs check)
when performing type inference (fyi, such a dynamic
Yes, FDs and ATs have the exact same problems when it comes to termination.
The difference is that ATs impose a dynamic check (the occurs check)
when performing type inference (fyi, such a dynamic check is sketched
in a TR version of the FD-CHR paper).
A problem with ATs at the moment is that
Ross Paterson writes:
(see the FunctionalDependencies page for background omitted here)
One of the problems with the relaxed coverage condition implemented
by GHC and Hugs is a loss of confluence. Here is a slightly cut-down
version of Ex. 18 from the FD-CHR paper:
class B a
Manuel M T Chakravarty writes:
Simon Peyton-Jones:
My current take, FWIW.
[...]
Tentative conclusion: H' should have MPTC + FDs, but not ATs.
My conclusion is that we should not include FDs or ATs into the standard
at the moment. Standardising FDs as a stopgap measure may
out before any AT program can be
encoded with FDs but the other direction does not hold necessarily.
See the above paper for details.
Manuel M T Chakravarty writes:
From: Martin Sulzmann [EMAIL PROTECTED]
Subject: MPTC/FD dilemma
FYI, Chameleon supports a combination of lexically scoped
and partial type annotation. The latest Chameleon version
is a broken (fix on its way). Though, besides the implementation
there's also a concise formal description. See
[July 2005] Lexically Scoped Type Annotations
to unrestricted type class programming
CHRs are the way to go. CHRs have a clean semantic meaning and
precisely explain the meaning of type class programs.
Martin
Claus Reinke writes:
I'm forwarding an email that Martin Sulzmann asked me to post on his
behalf.
thanks. well, that is one view
13 matches
Mail list logo