首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >从Halogen获得“无限类型的表达式”,用于查询/请求

从Halogen获得“无限类型的表达式”,用于查询/请求
EN

Stack Overflow用户
提问于 2018-11-10 10:18:39
回答 1查看 51关注 0票数 0

在我的部分:

代码语言:javascript
复制
data Query a = SetImageUrl Int String a

主要(app)组件:

代码语言:javascript
复制
  eval :: Query ~> H.ParentDSL State Query ChildQuery ChildSlot Void m
  eval = case _ of
    HandleItemChange groupId (LIS.ActiveChanged selected) next -> do
      let apReq = AP.SetImageUrl groupId (imageUrl selected)
      _ <- H.query' CP.cp2 AvatarPictureSlot (H.request apReq)
      pure next

编译器说:

代码语言:javascript
复制
[1/1 InfiniteType] src/App.purs:85:57

  85        _ <- H.query' CP.cp2 AvatarPictureSlot (H.request apReq)
                                                              ^^^^^

  An infinite type was inferred for an expression:

    t0 -> t0

  while trying to match type t0 -> t0
    with type t0
  while checking that expression apReq
    has type (t0 -> t0) -> t1 t0
  in value declaration app

  where t0 is an unknown type
        t1 is an unknown type

我认为插槽和子路径是可以的,因为render函数编译和工作正常。

如何修复这个错误?我检查了几次指南,但是我没有看到任何不同,编译器消息对我来说是非常没有帮助的。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-11-11 13:46:56

github的解决方案:

代码语言:javascript
复制
  _ <- H.query' CP.cp2 AvatarPictureSlot (H.action apReq)

对于不返回任何内容的查询,应该使用H.action而不是H.request

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/53237962

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档