[Haskell-cafe] ANNOUNCE: HStringTemplate -- An Elegant, Functional,
Nifty Templating Engine for Haskell
jules at jellybean.co.uk
Fri Jan 18 05:29:24 EST 2008
[removed haskell@ from the cc: list, which I think is conventional if
Graham Fawcett wrote:
> On Jan 14, 2008 2:47 AM, Sterling Clover <s.clover at gmail.com> wrote:
>> HStringTemplate is a port of Terrence Parr's lovely StringTemplate
>> (http://www.stringtemplate.org) engine to Haskell.
> This is very cool.
> Your docs describe a function, cacheSTGroup:
> cacheSTGroup :: Int -> STGen a -> STGen a
> Given an integral amount of seconds and a group, returns a group
> cached for that span of time. Does not cache "misses."
> How does this work without breaking referential transparency?
> Shouldn't it be in the IO monad if it is time-dependent?
If the result is always the same, but only efficiency varies, then you
could argue it's still referentially transparent.
Of course, if the result isn't always the same (template file could be
changed underneath you) then it isn't... the list is already aware of my
views on behind-the-scenes lazy IO :)
More information about the Haskell-Cafe