Re: Implementation idea for unboxed polymorphic types

2016-01-05 Thread Ömer Sinan Ağacan
That's a really good question, I think. I tried to make it working here: https://gist.github.com/osa1/00597c24a79816c7ef90/ In that code, just assume whenever you see a type or constructor with Ubx prefix it's just magically get unboxed. I added lots of inline comments about problems and results

Re: Implementation idea for unboxed polymorphic types

2015-11-17 Thread Alexey Vagarenko
At the moment, GHC does not support type families over kind #, but if it did, would this code do the trick https://gist.github.com/vagarenko/077c6dd73cd610269aa9 ? 2015-11-16 22:32 GMT+05:00 Ömer Sinan Ağacan : > > But I don't see why you'd need quoting at constructor

Re: Implementation idea for unboxed polymorphic types

2015-11-16 Thread Ömer Sinan Ağacan
> But I don't see why you'd need quoting at constructor calls. Couldn't you > just have a type class like `PointFamily`? This is exactly right, my memory has failed me. My initial implementation didn't use the type family trick, I had further attempts that use type families but honestly I don't

Re: Implementation idea for unboxed polymorphic types

2015-11-15 Thread Ömer Sinan Ağacan
I had started working on exactly the same thing at some point. I had a TemplateHaskell-based implementation which _almost_ worked. The problem was that the syntax was very, very heavy. Because I had to use quotes for _every_ constructor application(with explicitly passed types). (because I had a

Implementation idea for unboxed polymorphic types

2015-11-15 Thread Francesco Mazzoli
(A nicely rendered version of this email can be found at ) ## Macro types I very often find myself wanting unboxed polymorphic types (e.g. types that contain `UNPACK`ed type variables). I find it extremely frustrating that it's easier to

Re: Implementation idea for unboxed polymorphic types

2015-11-15 Thread Richard Eisenberg
After reading Francesco's original post, I immediately thought of Ömer's proposed approach, of using Template Haskell to produce the right data family instances. But I don't see why you'd need quoting at constructor calls. Couldn't you just have a type class like `PointFamily`? I'd be more