4 ms·
If I understand the paper correctly, reflection in 8.2 involves some crafty use of GADTs and compiler primitives to create a type descriptor of sorts that allow
by MHordecki 9y ago
If I understand the paper correctly, reflection in 8.2 involves some crafty use of GADTs and compiler primitives to create a type descriptor of sorts that allows you to decompose values at runtime in a typesafe manner, while still allowing for erasure.
Paper: https://www.microsoft.com/en-us/research/wp-content/uploads/2016/08/dynamic.pdf https://www.microsoft.com/en-us/research/wp-content/uploads/...
Package: https://downloads.haskell.org/~ghc/latest/docs/html/libraries/base-4.10.0.0/Type-Reflection.html https://downloads.haskell.org/~ghc/latest/docs/html/librarie...
- z1mm32m4n 9y agoOh wow this is going to be a joy to read, thanks! Only a couple pages in and it already looks well-written and thorough. Also there's this: "This paper is literate Haskell and our examples compile under GHC 8.0." A 26 page, typeset paper is certainly the longest example of a literate Haskell program I've come across! Wow.