Why does this Haskell code produce the “infinite type” error?

后端 未结 4 1543
青春惊慌失措
青春惊慌失措 2020-12-13 03:27

I am new to Haskell and facing a \"cannot construct infinite type\" error that I cannot make sense of.

In fact, beyond that, I have not been able to find a good exp

4条回答
  •  爱一瞬间的悲伤
    2020-12-13 03:47

    Also I found this which explains the meaning of the error.

    Every time the interpreter/compiler gives me this error it's because I'm using some type-parametrized tuple as formal parameter. Everything works correctly by removing the type definition of the function, which was containing type variables.

    I still cannot figure out how to both fix it and keep the function type definition.

提交回复
热议问题