Getting “An infinite type was inferred for an expression” for query'/request from Halogen
up vote
0
down vote
favorite
In my component:
data Query a = SetImageUrl Int String a
Main (app) component:
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
Compiler says:
[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
I think slots and child paths are alright, because render
function compiles and works correctly.
How to fix this error? I checked several times against guide, but I simply don't see any difference and the compiler message is super unhelpful (for me).
purescript purescript-halogen
add a comment |
up vote
0
down vote
favorite
In my component:
data Query a = SetImageUrl Int String a
Main (app) component:
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
Compiler says:
[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
I think slots and child paths are alright, because render
function compiles and works correctly.
How to fix this error? I checked several times against guide, but I simply don't see any difference and the compiler message is super unhelpful (for me).
purescript purescript-halogen
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
In my component:
data Query a = SetImageUrl Int String a
Main (app) component:
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
Compiler says:
[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
I think slots and child paths are alright, because render
function compiles and works correctly.
How to fix this error? I checked several times against guide, but I simply don't see any difference and the compiler message is super unhelpful (for me).
purescript purescript-halogen
In my component:
data Query a = SetImageUrl Int String a
Main (app) component:
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
Compiler says:
[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
I think slots and child paths are alright, because render
function compiles and works correctly.
How to fix this error? I checked several times against guide, but I simply don't see any difference and the compiler message is super unhelpful (for me).
purescript purescript-halogen
purescript purescript-halogen
asked yesterday
menfon
173110
173110
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
Solution from github:
_ <- H.query' CP.cp2 AvatarPictureSlot (H.action apReq)
For queries not returning anything one should use H.action
not H.request
.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
Solution from github:
_ <- H.query' CP.cp2 AvatarPictureSlot (H.action apReq)
For queries not returning anything one should use H.action
not H.request
.
add a comment |
up vote
0
down vote
Solution from github:
_ <- H.query' CP.cp2 AvatarPictureSlot (H.action apReq)
For queries not returning anything one should use H.action
not H.request
.
add a comment |
up vote
0
down vote
up vote
0
down vote
Solution from github:
_ <- H.query' CP.cp2 AvatarPictureSlot (H.action apReq)
For queries not returning anything one should use H.action
not H.request
.
Solution from github:
_ <- H.query' CP.cp2 AvatarPictureSlot (H.action apReq)
For queries not returning anything one should use H.action
not H.request
.
answered 18 hours ago
menfon
173110
173110
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53237962%2fgetting-an-infinite-type-was-inferred-for-an-expression-for-query-request-fro%23new-answer', 'question_page');
}
);
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password