haskell - How do I gain access to environment variables in a subsite that is in a separate package? -


my yesod subsite needs write files relative application's root directory.

looking @ this, appears scaffolded yesod site of plumbing, how can access in subsite doesn't know app record?

approot defined in scaffolded yesod project using reference appsettings, also element of app:

approot = approotmaster $ approot . appsettings 

is there function gives me application root (or @ least valid file path root directory) without having know implementation details? being able reuse existing yesod functionality nicest, of course.

you can't access master site's fields without knowing type of master site itself, defeats purpose of having subsite. typical options are:

  1. make data you're looking explicit argument subsite
  2. require typeclass constraint master site must instance of, gets data master site

yesod-static example of former approach; yesod-auth example of latter.


Comments

Popular posts from this blog

tcpdump - How to check if server received packet (acknowledged) -