Closed BebeSparkelSparkel closed 4 months ago
I'll try to add some tests this week
Added tests and fixed error for list instance.
Question: Should initTails [] == [([],[])]
or initTails == []
?
I honestly have no idea, I've never used that function. Is there any prior art you're aware of for a definition?
One invariant of this function seems to be that
length xs + 1 == length (initTails xs)
therefore initTails [] == [([], [])]
is the correct choice.
I have received comment from @tomjaguarpaw above and Atijohn.
Both recommend initTails [] == [([], [])]
, as now implemented, with good reasoning.
So, this is ready to go.
Thanks!
Here is my example implementation. I have only added:
tails
,inits
,initTails
toclass IsSequence
Can you review for correctness and then I will add it to the other instances?
I am unsure how to add this to tests. How should I add the tests?
closes #213