sellout / dualizer

Delete half (minus ε) of your Haskell code!
GNU Affero General Public License v3.0
30 stars 1 forks source link

Simultaneous thing-and-dual definition. #3

Closed sellout closed 6 years ago

sellout commented 6 years ago

As mentioned by @rocketnia in https://github.com/sellout/dualizer/issues/2#issuecomment-351828855, it’d be cool to be able to define both a thing and its dual together, allowing explicit “levels” of arrows, etc.

I’m envisioning something like invertible-syntax, which is “just” a particular case of this problem.

sellout commented 6 years ago

Oh what? This works now!

Kind of had to be done, because this is the only way to actually create the dual of an expression, since GHC doesn’t want to give us the expression for an arbitrary name (http://hackage.haskell.org/package/template-haskell-2.12.0.0/docs/Language-Haskell-TH-Syntax.html#v:VarI)