https://github.com/philzook58/staged-fun
Tinkering around with staged metaprogramming
https://github.com/philzook58/staged-fun
Last synced: 8 months ago
JSON representation
Tinkering around with staged metaprogramming
- Host: GitHub
- URL: https://github.com/philzook58/staged-fun
- Owner: philzook58
- License: bsd-3-clause
- Created: 2019-02-19T21:43:06.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-03-04T00:07:22.000Z (over 6 years ago)
- Last Synced: 2025-01-08T15:34:45.710Z (9 months ago)
- Language: Haskell
- Size: 7.81 KB
- Stars: 1
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: ChangeLog.md
- License: LICENSE
Awesome Lists containing this project
README
# staged
A repo for playing with staged metaprogramming in Haskell.
Links:
https://www.youtube.com/watch?v=AzJVFkm42zM&t=1995s
http://mpickering.github.io/posts/2019-02-14-stage-3.html
https://github.com/mpickering/three-level
http://okmij.org/ftp/meta-programming/index.html
https://www.nowpublishers.com/article/Details/PGL-038
https://markkarpov.com/tutorial/th.html
SPJ talk
https://www.cl.cam.ac.uk/events/metaprog2016/Template-Haskell-Aug16.pptxinteresting error handling stuff.
Tim Sheard lecture
web.cecs.pdx.edu/~sheard/course/AdvancedFP/notes/StagingInHaskell.pdfGHC manual section
https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/glasgow_exts.html#th-usagestaged interpeters
quotations
splice - turnslifting - cross stage persistance thorugh serialization?
typed template haskell as of ghc 7.8. Two levels only? no polymorphic lift.
Not necessarily connected, but often occur together - tagless final
tagless final makes a dsl by replacing every constructor of your dsl data type by a method in a typeclass
data FreeNum a = Add FreeNum FreeNum | Sub FreeNum | Pure a | Times FreeNum FreeNum |
data FreeMonoid a = MAppend FreeMonoid FreeMonoid | Mempty | Pure a->
class Num
class Monoid
etc.sometimes your dsl includes binding forms, in which case everything gets a little more confusing.
The template haskell dump is in the .stack-work folder deep down
dist/x86/Cabal/build/ src or exectutable in .dump-splices files