haskell - 使用 optparse-applicative 的程序的(键入)参数列表
问题描述
有没有办法从命令行程序中提取名称和类型列表,使用optparse-applicative
?
我正在 +/- 寻找一些类型的功能ParserInfo a -> [(String,TypeRep)]
解决方案
不,没有办法。相关位是:
data ParserInfo a = ParserInfo
{ infoParser :: Parser a
, -- ...
}
data Parser a
= forall x . MultP (Parser (x -> a)) (Parser x)
| forall x . BindP (Parser x) (x -> Parser a)
| -- ...
由于 和 的sx
是存在量化的并且不带有约束,因此有关在树的叶子上使用的类型的信息在运行时会丢失。MultP
BindP
Typeable
Parser a
推荐阅读
- http - 为什么 IE 使用不同的用户代理字符串重复请求,但没有会话 cookie?
- sql-server - 计算表名在存储过程中出现的次数
- flutter - Flutter:SliverPersistentHeader 在滚动时重建自身
- c# - 正则表达式在电子邮件正文中查找有效 URL,而不管换行符是否分割它,并且它需要包含“?” 特点
- node.js - 错误:forEach 未定义
- c# - 按下按钮时 Unity 再次运行非循环动画
- node.js - 将 Node.js BOT 连接到 MS Azure SQL 数据库
- android - 通过意图在活动之间传递变量会引发 NullPointerException
- ios - Swift iOS -AshleyMills Reachability 每隔几秒就会打开和关闭 wifi
- asp.net - 没有“访问控制允许来源”的请求 - Angular 4 / ASP.net