Unify monadic and pure implementation
- Linguagem predominante
- Haskell
- Estrelas
- 98
- Forks
- 17
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Descrição
The pure implementation should be a specialized version of the monadic code to Identity. Goal: remove code duplication
However, the resulting Core for pure and monadic Identity should be really quite similar to ensure performance doesn't regress in the pure case.
Unfortunately, when I tried to do this last I found the generated code for the monadic code specialized at Identity was wildly different from the pure version.
Notably, `>>=` and friends weren't being inlined. This is critical!
It turns out Identity's Functor, Applicative, Monad instances don't have `INLINE` pragmas (awful!)
I intend to open a CLC proposal to add INLINE pragmas to Identity's instances, pointing to here as a real world example where it was found that the definition wasn't enough.
However, `hegg` will likely still want a solution which doesn't regress performance for older base versions. I'm thinking we could define our own `Identity` type with INLINE pragmas.
Guia de contribuição
Nenhum guia de contribuição indexado para este repositório
Avaliação
Esta issue ainda não foi avaliada.