[Haskell-cafe] Re: [darcs-conflicts] how to nicely implement phantom type coersion?

2005-12-09 Thread Taral
On 12/8/05, David Roundy [EMAIL PROTECTED] wrote: So is there some other approach that I can use for easily coercing phantom types based on runtime checks? Any suggestions? None here. Since H-M uses type unification to do type inference, you can't auto-create a program based on the inferred

[Haskell-cafe] Re: [darcs-conflicts] how to nicely implement phantom type coersion?

2005-12-08 Thread Ian Lynagh
On Thu, Dec 08, 2005 at 09:23:22AM -0500, David Roundy wrote: data EqContext a b = EqContext { safe_coerce :: f(a,b) - f(b,a) } where f(a,b) is a function of two types that returns a type, so the value of f(a,b) might be (Patch a b) or (Patch x b) or something like that. But I'm not sure

[Haskell-cafe] Re: [darcs-conflicts] how to nicely implement phantom type coersion?

2005-12-08 Thread Jim Apple
Ralf Hinze wrote: the type a :=: b defined below goes back to Leibniz's principle of substituting equals for equals: If you like this, check out two of Ralf's papers: First-class phantom types: http://techreports.library.cornell.edu:8081/Dienst/UI/1.0/Display/cul.cis/TR2003-1901 Fun with