在Haskell中,当我输入一个有序数字列表时,如何创建一个列表,其中包含数字和bool的所有可能组合(True或False)?
例如,当我输入[1,2]时 ,输出为:
[ [(1,False),(2,False)] , [(1,False),(2,True)] , [(1,True),(2,False)] , [(1,True), (2,True)] ]
combinations haskell
combinations ×1
haskell ×1