Re: Maybe String -> CoreExpr in a GHC plugin

2018-01-19 Thread Joachim Breitner
Hi, Am Dienstag, den 16.01.2018, 11:08 -0500 schrieb Joachim Breitner: > in a GHC plugin, I want to synthesize simple data structures, and > insert them into the code. What is the most idiomatic way of writing a > function, say, > > foo :: Maybe String -> CoreExpr > > or > > foo :: Maybe St

Why is EvTerm limited?

2018-01-19 Thread Joachim Breitner
Hi, I had some funky idea where a type checker plugin would have to synthesize code for a custom-solved instances on the fly. But it seems that does not work because EvTerm is less expressive than Core (especially, no lambdas): https://downloads.haskell.org/~ghc/8.2.2/docs/html/libraries/ghc-8.2.2

RE: Why is EvTerm limited?

2018-01-19 Thread Simon Peyton Jones via Glasgow-haskell-users
| What would break if we had | | | EvExpr CoreExpr | | as an additional constructor there? This has come up before. I think that'd be a solid win. In fact, eliminate all the existing evidence constructors with "smart constructors" that produce an EvExpr. That'd mean moving stuff from