Yes, you are pretty much correct. Although I wouldn't say they are like global variables. They are more like global constants, or a global API. I view compiled splices as an API that your web designer can use to interact with dynamic data.
Compiled splices allow you to insert holes into your markup that get filled with data at runtime. At load time the running monad is HeistT n IO
. But at run time the running monad is RuntimeSplice n
. So if you're looking at the compiled Heist API, it's very easy to see where the runtime code like database functions need to be: in the RuntimeSplice n
monad.