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).










share|improve this question


























    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).










    share|improve this question
























      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).










      share|improve this question













      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






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked yesterday









      menfon

      173110




      173110
























          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.






          share|improve this answer





















            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














             

            draft saved


            draft discarded


















            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
































            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.






            share|improve this answer

























              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.






              share|improve this answer























                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.






                share|improve this answer












                Solution from github:



                  _ <- H.query' CP.cp2 AvatarPictureSlot (H.action apReq)


                For queries not returning anything one should use H.action not H.request.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 18 hours ago









                menfon

                173110




                173110






























                     

                    draft saved


                    draft discarded



















































                     


                    draft saved


                    draft discarded














                    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




















































































                    Popular posts from this blog

                    Florida Star v. B. J. F.

                    Error while running script in elastic search , gateway timeout

                    Adding quotations to stringified JSON object values