I’m writing an application in Haskell that compiles both to native and to WASM, using the GHC backend. I would like to be able to embed a directory of text files in the binary; is there a way to do that? I thought of using Template Haskell + something like file-embed but as far as I can tell TH doesn’t work on WASM. Is there any other way I can do that, or can I get TH to work? (using TH would actually solve some other issues too, but i’ve worked around the ones i’ve encountered so fa...| Haskell Community
To explain these concepts in more detail, you want a Sigma type (n :: Nat, Vect (n :: Nat) a) But we don’t have those in Haskell. Instead you can have a second class existential type by writing it as a GADT: data SomeVect a where SomeVect :: (n :: Nat) -> Vect (n :: Nat) a -> SomeNat a -- ^ This is not yet valid Haskell! But we don’t have dependent types either! Instead there is a singleton type SNat :: Nat -> Type that does a similar job. It’s called a “singleton” because there is ...| Haskell Community