Hi,
small update: I generalized the code at
https://github.com/nomeata/nt-coerce/blob/9349dd3/GHC/NT/Plugin.hs
a bit, it is now able to handle to create NT-values for unwarpping
arbitrary newtypes and for lifting across type constructors. It does so
unconditionally, i.e. does _not_ yet check wheth
Hi again,
Am Mittwoch, den 03.07.2013, 10:01 +0200 schrieb Joachim Breitner:
> Am Dienstag, den 02.07.2013, 16:28 + schrieb Simon Peyton-Jones:
> > | I also noticed a problem with my logic for creating the NT-lifting
> > | function. Suppose
> > | data C a = MkC (Foo a)
> > | Just having the
| Is this really the compiler’s job here? After all, the programmer would be
able to
| write
|
| deriving cNT' :: NT (Foo a) (Foo b) -> NT (C a) (C b)
| cNT :: NT a b -> NT (C a) (C b)
| cNT = cNT' . fooNT
|
| and expose just cNT to his users, so no expressiveness
On Wed, Jul 3, 2013 at 5:33 AM, Joachim Breitner
wrote:
> [snip]
>
> strange, why did I miss that?
>
> But I can’t get [the GlobalRdrEnv lookup] to work, even looking up an
> element that I took from
> the GRE itself returns []:
>
> let e' = head (head (occEnvElts env))
> putMsgS $ showSDo
Hi,
Am Dienstag, den 02.07.2013, 12:56 -0500 schrieb Nicolas Frisby:
> For my light experimentation, I have recovered these two values from
> the ModGuts that all plugins receive. Hopefully someone will shout out
> if there's pitfalls to avoid.
>
> * The mg_rdr_env field is of type GlobalRdrEnv
Hi,
Am Dienstag, den 02.07.2013, 16:28 + schrieb Simon Peyton-Jones:
> | I also noticed a problem with my logic for creating the NT-lifting
> | function. Suppose
> | data C a = MkC (Foo a)
> | Just having the constructors of C in scope is not sufficient
> | to safely provide
> | NT
This is an exciting effort! Just a quick reaction to Simon's comments on
CoreM.
On Tue, Jul 2, 2013 at 9:11 AM, Simon Peyton-Jones wrote:
> To your questions:
>
> **
>
> **·**To do these kind of things, CoreM will need more reader
> stuff. In particular:
>
> **o **The global TypeE
| I also noticed a problem with my logic for creating the NT-lifting
| function. Suppose
| data C a = MkC (Foo a)
| Just having the constructors of C in scope is not sufficient
| to safely provide
| NT a b -> NT (C a) (C b)
| as the parameters of the constructor might wrap a in another
Hi,
Am Dienstag, den 02.07.2013, 14:11 + schrieb Simon Peyton-Jones:
> I'm not sure that a plugin is the way to go here, though it's a good
> start.
as I said, it is just to host the prototype that allows for quick
experimentation and allows people to test it without having to compile
GHC.
ers-
| boun...@haskell.org] On Behalf Of Joachim Breitner
| Sent: 01 July 2013 13:00
| To: glasgow-haskell-users@haskell.org
| Subject: Exposing newtype coercions to Haskell
|
| Hi,
|
| this is related to
| http://hackage.haskell.org/trac/ghc/wiki/NewtypeWrappers#Proposal3.
| I tried
Hi,
this is related to
http://hackage.haskell.org/trac/ghc/wiki/NewtypeWrappers#Proposal3.
I tried to hack up a little prototype of this, and this “works” now:
import GHC.NT
newtype Age = Age Int deriving Show
ageNT :: NT Age Int
ageNT = createNT
11 matches
Mail list logo