logo
首页技术栈工具库讨论
modulespection

modulespection

Collect all of the declarations in a module using Template Haskell (via the GHC API). One can either get all the names, or just the declarations (only type declarations are supported right now). Here is a quick example: Which will spew the following when compiling: There is also declarations which can be used, for example, to make sure that all types have ToJSON/FromJSON instances. Which will make JSON instances for Test, OtherTest and any other types added to the file. You can also do the same thing for an existing module. Which will build instances for all the types in Data.Monoid.
由 
bruceshi2021-01-13 收录
--
推荐
不推荐
更多信息
HACKAGE
carbal install modulespection
查看
标签
根据用户添加的标签生成
暂无标签