[Haskell-cafe] An issue with EDSLs in the ``finally tagless'' tradition

Peter Gammie peteg42 at gmail.com
Thu Sep 24 01:10:03 EDT 2009


Brad,

On 24/09/2009, at 2:45 PM, Brad Larsen wrote:

> On Thu, Sep 24, 2009 at 12:22 AM, Peter Gammie <peteg42 at gmail.com>  
> wrote:
> [...]
>
>> Ambiguity is IMHO best handled with a judicious application of type  
>> (or
>> data) families, but you can get surprisingly far by simply  
>> requiring that
>> every class member mention all type variables in the class head.  
>> YMMV of
>> course.
>
> Can you say more about the use of type/data families?

Multi-parameter type classes generally lead to ambiguity - see the  
classic paper(s) by Simon PJ et al for some good examples.

In the context of Arrows, I used type/data families to make the  
representation type (e.g. Integer) a function of the arrow (e.g. a  
direct semantics), which makes life a bit easier for using this stuff  
but is not completely faithful to what I wanted. (Imagine you want to  
mix Integer and Double in the same expression.)

Hope this helps!

cheers
peter

-- 
http://peteg.org/



More information about the Haskell-Cafe mailing list