Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
I have updated description ("Order of inhabitants in infinite lists won't be tested."), hope it clarifies it. It was complementary task, so I think strictness is unnecessary.
This comment is hidden because it contains spoiler information about the solution
I'm very confused by one of the tests:
pred (successor x) == Just x
But
pred = nat Nothing Just
. How can this possibly be true for anyx
?In addition, according to the approach, mentioned in that paper, you could implement set of all subsets in haskell as
Good question)
Yes, when
count @t
is infinity we could not conclude, thatt
is countable (in mathematical sense).So ℵ0 =
count @Nat < count @[Nat]
= 2ℵ0 in terms of cardinal numbers,and type/set
t
is countable iffcount @t == count @Nat
.We can not express such things in haskell, so when infinity, we just write all formally.
Also if
count @x >= 2
then typeNat -> x
is not countable.Is
Listable c => Listable [c]
actually true? I have some sort of feeling that this implies that the reals are enumerable.Consider http://faculty.washington.edu/keyt/reals.pdf. Briefly this says:
The second bullet is important. We show in the kata that the natural numbers are enumerable. So, if we have
Listable c => Listable [c]
, then we violate the second bullet, don't we?Yeh, same for me. First couple of submits timed out, then eventually came in just under 12s.
Anyone got any advice for optimisation in Haskell? I'm stuck timing out on the slow programs.