7 kyu
functions $$$ of $$ multiple $ arguments
Loading description...
Algorithms
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
I'm passing sample tests, but on submit I get the error below. What's going on?
Tests are trying to
show
a function, which it can't.I can see your solution, but I can't see what's wrong with either your solution or the tests. I'm sorry; I'll keep looking.
Apparently this is not an easy 7 after all. GHC is quite stubborn and fussy. There are ( multiple ) solutions possible, I promise, but I still can't explain just why yours shouldn't work.
Without giving too much away, I can only say: keep it simple, as simple as possible.
I made it as simple as I could. What I don't get is why it passes sample tests, but not test cases.
I don't either. Sorry.
It works without the type signatures. ( It can also work with simpler type signatures. ) For your implementation, the compiler pragma is unnecessary, but I don't think that's what causing the failures.
The problem may be that nested
$$
s don't play nice with overly specific type signatures. ( The library$
has a rather complicated type and some unintelligible explanation for that. ) But that's a shot in the dark.I came close to solving it :)
You definitely had the right idea. Morally, you solved it. :]
Well, I finally made it. Needed a complete strip down, which makes me think whether the spec is ok. ($$) should also work with less than 2 arguments etc ..
This comment has been hidden.
I thought those were the same O_o
Edit: memowe's solution doesn't seem to pass actually, presumably caused by a change in version...?
I'm beyond confused
I was also absolutely convinced those are the same. I still am - submit tests are not working for me with that type signature.
This comment has been hidden.
If I specify such, is it reasonable to expect
f $ x
,f $$ x
andf $$$ x
to all work, in addition tof $$ x $ y
andf $$$ x $$ y $ z
?Or should I only require multiple
$
s to have as least as many arguments as there are$
s ?Also, I should probably have all the submit tests as example tests. No reason why not.
I think if you add all the submit tests as sample tests, it would become apparent. Whether to change the description is up to you.