1

I'm use wai to build a web backend.

And I want to know the which kind of data save in the requst's vault.

But I don't know how to check which keys are already in this vault.

I find the https://github.com/HeinrichApfelmus/vault/blob/master/src/Data/Vault/ST/ST.hs

and try with

import qualified Data.Vault.ST.Lazy as DV

checkVault (DV.Vault v) = do
     putStrLn $ show $ v

But the ghc said "Not in scope: data constructor ‘DV.Vault’"

Is there any way I can get the vault's Keys?

Or where is the docs I can know which data wai save in this vault.

Julian.zhang
  • 709
  • 1
  • 7
  • 11
  • 2
    `Vault` is intentionally abstract so your code doesn't work because it would break abstraction. You cannot get a list of the keys of a vault because this function would not be well typed - what would its type be? `Vault -> [Key a]`? How do you pick an `a`? What if the Vault contains values of different types? The output list then must be heterogeneous, and its type must depend on the value of the vault. Perhaps you can elaborate as to what problem you are actually trying to solve. – user2407038 Mar 23 '15 at 07:20
  • dear @user2407038, I just want check which data wai had save in the Vault. So in your opinion the only way is find the wai's code or doc? – Julian.zhang Mar 23 '15 at 07:50

0 Answers0