In pseudo-code, your list comprehension
[v:vs | v <- tValue
, vs <- tValues (n-1) ]
equals
for any combination of two elements in `tValue` and `tValues (n-1)`
cons the first onto the latter
However, tValues
has no elements to begin with, it is an empty list. Lets simulate this for n = 1
:
tValues 1 = [v:vs | v <- tValue
, vs <- tValues 0 ]
= [v:vs | v <- [True, False]
, vs <- [] ]
-- since there is no vs
= []
This propagates throughout the whole recursion. The solution is quite simple: change the base case to contain an empty combination:
tValues 0 = [[]] -- or: return []
Now the simulation yields:
tValues 1 = [v:vs | v <- tValue
, vs <- tValues 0 ]
= [v:vs | v <- [True, False]
, vs <- [[]]]
-- vs is []
= [True:[],False:[]]
= [[True],[False]]
Which is just what we wanted.