在haskell的99 problems https://wiki.haskell.org/99_questions/Solutions/27中,我很难概念化问题27的答案。问题:“将集合中的元素分组为不相交的子集。
a) 9个人的小组可以以多少种方式在3个不相交的2人、3人和4人小组中工作?编写一个函数来生成所有的可能性,并在列表中返回它们。我对haskell也很陌生,所以给我解释一下,就像我是五年级
listItem a]parse error in constructor in data/newtype declaration: (Integer, a) bound by the type signature for at 99problems.hsvariable bound by
the type signature for
我是Haskell的新手,面临着一个“无法构造无限类型”的错误,我无法理解这个错误。事实上,除此之外,我还没有找到一个很好的解释这个错误意味着什么,所以如果你可以超越我的基本问题,解释“无限类型”错误,我真的很感激。[ [1,2,3],[4,5,6],[7,8,9]]-- [1,2,3,-99,4,5,6,-99,7,8,9]
intersperses (x:xs) = x ++ s:intersperse s