snoyberg/file-embed — pull request #5 by kuznero (2013-11-27 00:06:12+00:00)
Title: Embed existing file out of paths supplied

Hello Michael,

Please review the change. I'm not sure if you accept any changes into file-embed package...
But just in case you will find it useful, here is what I did: I introduced another embedFile' function that accepts list of paths out of which first existing path will be used to embed file as a resource.

This task arose from the fact that I use Haskell projects with cabal file and from src/ folder in GHCi. Thus, relative paths to my resources are normally working either when compiling with cabal or when working with GHCi, but not both. So, with this change I could make it working for both ways by doing something like this:

resource :: String
resource = decode $ B.unpack $( embedFile' [ "src/resources/file.txt", "resources/file.txt" ] )

Thanks in advance,
Roman Kuznetsov