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.
Can you force
{-# OPTIONS_GHC -Wincomplete-patterns -Werror=incomplete-patterns #-}
?
It would ban solutions like this. In previous catas too.
Yeah, you can use infinite types if you wrap them in a
newtype
.Oh damn,
PRight
is not applied to the continuation but to the initial value. Yep, you're right. So it can't be done.Thanks!
I get that, but why must it be
S a
in the first place?If we have
Paren a -> Paren a
, applyPRight
first, thenk
, thenPLeft
, we can feed itParen Z
, we don't need the input to beParen (S a)
. This is dependent upon evaluation otder; if you start withPLeft
, you do needParen (S a)
.But I have been unable to force that order, so I don't know if that would make it what I would like it to be.
That's what GHC tells me. But it needs not, depending on evaluation order. It could have
Paren Z
everywhere.I really hope I can find a way to ban this solution.
But let me tell a story. We got detective and criminal fighting with each other. The bad thing is:
Then detective carfully using axioms and modus ponens to find the solution. So... :p
> <
Intended. It was already stated in the section comments.