unison icon indicating copy to clipboard operation
unison copied to clipboard

Remove eta expanded ability operation in docs

Open pchiusano opened this issue 3 years ago • 4 comments

{{

```
Stream.toList! ’let foreach Stream.emit [“duck”, “rabbit”, “beaver”]
}}
```

This shows _eta -> Stream _eta in the rendered form of the example.

pchiusano avatar Feb 23 '22 18:02 pchiusano

This is still happening, and I think the reason is that this variable somehow becomes a User "_eta" instead of an Eta.

runarorama avatar Dec 01 '22 02:12 runarorama

Idea for fix: just do eta reduction willy nilly during decompilation. While eta reduction isn't safe general for function with arbitrary effects, if the function just calls a data constructor (not an ability constructor), it's safe.

pchiusano avatar May 17 '23 15:05 pchiusano

Implementation idea: more calls to etaReduceEtaVars in Decompile.hs. Maybe a "safe" version of eta reduce that only does it for data constructor calls.

pchiusano avatar May 17 '23 15:05 pchiusano

Hit this again. It makes my otherwise lovely code...

CleanShot 2024-07-17 at 14 44 20@2x

... turn into this monstrosity :)

CleanShot 2024-07-17 at 14 43 08

Gak!

pchiusano avatar Jul 17 '24 18:07 pchiusano