haskell - 参数数据构造函数和 GADT:不在范围数据构造函数中
问题描述
解决方案
In RelationTest.hs
file, you are importing specific type constructors from the Relation
module using the following:
import Relation (FromValueToSchema,bindType,schema,rows,Relation)
When it comes to data types, this only imports the type constructor. The data constructor(s), possible methods and field names are not imported. Adding a (..)
to the end of a type constructor or class will import all of their possible members. Like follows:
import Relation (FromValueToSchema,bindType,schema,rows,Relation(..))
Section 5.3.1 of the Haskell Report states:
Exactly which entities are to be imported can be specified in one of the following three ways:
- The imported entities can be specified explicitly by listing them in parentheses. Items in the list have the same form as those in export lists, except qualifiers are not permitted and the `module modid' entity is not permitted. When the (..) form of import is used for a type or class, the (..) refers to all of the constructors, methods, or field names exported from the module.
推荐阅读
- python - 如何正确激活 RunIfOutofBounds?
- reactjs - 我如何在 redux 中测试组件
- flutter - 我的 Timer 快疯了,它会减少 2 , 3 秒,而它应该只有 1 (每秒都会调用 Timer)
- python - 在全国范围内访问 postgresql 数据库
- postgresql - 如何从另一个未完成的行更新一行
- c++ - 从堆栈中弹出时出现分段错误
- video - Dash js 获取视频字幕
- nginx - 为什么我无法访问 nginx 中的静态文件?
- javascript - 如何在组件中使用 react useRef
- javascript - 实时从 dynamodb 表中读取数据