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.
Added it, btw is there something like spoiler tag to make it collapsed initially and not clutter up description?
No, it is not abuse of logic:
fix (S . (* Z))
should have 1 ===S Z
as fixpoint, becauseS . (* Z) $ S Z = S Z
(1 + 1 * 0 = 1); and your definition successfully yields it forfix (S . (Z *)) = S Z
.Just in case: it has changed slightly.
This comment is hidden because it contains spoiler information about the solution
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.
Here:
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.You always can go to Solutions section and then Show Kata Test Cases.
Another approach (without
Proxy
, usingTypeApplications
) could be found in this kata.Here:
Description updated: both approaches are mentioned now.
In Test Cases random types are generated, and I don't know how to do it without
Proxy
-s and existentials, so I cannot completely avoid usingProxy
.Yes, you are right, I have updated tests for
Factor []
.Thank you for pointing it out!
Type
Void
has no constructors.It could be defined:
It is in base.
Loading more items...