Why is toList (1, 2) == [2]

后端 未结 3 1262
天涯浪人
天涯浪人 2021-01-12 22:58

As the question says, why is toList (1, 2) == [2]?

I remember something similar happening when fmapping on tuples, but I do not remember why or if it is

3条回答
  •  不知归路
    2021-01-12 23:46

    The results do make more sense when you interpret the function names like this:

    length - how many values will be touched by fmap, fold etc.

    toList - what elements will be touched by fmap, fold etc.

    As long as

    length x == length (toList x)
    

    the world is fine.

提交回复
热议问题