阅读 Yesod 的源代码,我遇到了带有“.hsfiles”扩展名的文件。示例: mongo.hsfiles 。它们是什么,为什么创建它们以及为什么使用它们?

最佳答案

可以看到here的相关代码:

backendBS :: Backend -> S.ByteString
backendBS Sqlite = $(embedFile "hsfiles/sqlite.hsfiles")
backendBS Postgresql = $(embedFile "hsfiles/postgres.hsfiles")
backendBS PostgresqlFay = $(embedFile "hsfiles/postgres-fay.hsfiles")
backendBS Mysql = $(embedFile "hsfiles/mysql.hsfiles")
backendBS MongoDB = $(embedFile "hsfiles/mongo.hsfiles")
backendBS Simple = $(embedFile "hsfiles/simple.hsfiles")
backendBS Minimal = $(embedFile "hsfiles/minimal.hsfiles")

因此,在他们的 Scaffolding 站点中使用它来生成默认值。

关于haskell - 什么是 hsfile?为什么使用 ".hsfiles"扩展名而不是常规的 ".hs"?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/30006503/

10-11 07:09