Haskell Tuple Size Limit

后端 未结 3 1053
离开以前
离开以前 2020-12-10 01:55

Why I can\'t construct large tuples in Haskell? Why there\'s a tuple size limit?

Prelude> (1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1)



        
3条回答
  •  既然无缘
    2020-12-10 02:21

    You can construct larger tuples, but you'll need to define them yourself. Secondly, you don't have a Show instance, so you would also need to write an instance for that.

    In general, it is a bad idea to use large tuples, when you should be using a smarter data type, such as a vector. We discourage the use by limiting the size provided by default.

提交回复
热议问题