Wait... what do you mean Core cannot generate new names to be exported.
I meant if I add a new name in the Core transformation, that doesn't
change the module's export list as seen by everything outside that
module. Which makes sense, it just means I have to change my approach.
Maybe you mean
Christopher Done wrote:
It's very easy to state this problem without enough details and mislead
people into providing a solution for a different problem, so I'll try to
include all the information and use-case. I need a function that can
store a value in a concrete opaque type. I know the type
On 4 October 2013 10:56, Heinrich Apfelmus apfel...@quantentunnel.de wrote:
In particular, the Locker stores arbitrary values like Dynamic , except
that values are extracted and removed with the help of a Key . This gets
rid of the Typeable constraint.
lock :: Key a - a - Locker
I can't
Christopher Done wrote:
On 4 October 2013 10:56, Heinrich Apfelmus apfel...@quantentunnel.de wrote:
In particular, the Locker stores arbitrary values like Dynamic , except
that values are extracted and removed with the help of a Key . This gets
rid of the Typeable constraint.
lock ::
| However, I want to write this as a core-to-core
| translation as a ghc-plugin. I want the definition go = putStrLn Hello
| World! to be translated to what I wrote above. Core cannot generate new
| names to be exported from a module, so go_ is now gone.
Wait... what do you mean Core cannot
Hi Chris,
Maybe this package (from Edward Kmett, surprisingly) could help:
http://hackage.haskell.org/package/constraints-0.3.3/docs/Data-Constraint.html?
Considering it kind of reifies the type class constraints, I'm wondering
whether you could use this to carry the constraints along the value
It's very easy to state this problem without enough details and mislead
people into providing a solution for a different problem, so I'll try to
include all the information and use-case. I need a function that can
store a value in a concrete opaque type. I know the type of the value
when I store