6 kyu
Binding of Algebraic Data Types
53Dr Gabo
Loading description...
Functional Programming
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.
Python Fork
@it
blocks (this makes it look like lots changed in full tests, but that is mostly just indent)Very nice kata btw :)
approved, one thing remained unclear to me from description, an "implicit conversion" is a "from -> to" from bindings (I would say this is an "explicit conversion"). Also "from -> to" and "to -> from" are two different kinds of conversions.
How does this random test makes sense? If both A and B are product types, all A's should be mappable to all B's? (which they are)
Maybe I'm reading the rules wrong, but I pass all of the fixed tests, but a lot of the random tests fail (and I cannot see why, when checking them manually)
if a and b are product types (a1&a2 and b1&b2) then
a1 must be bindable to b1, a2 to b2 and so on..
remember:subtypes may have more than 2 types or may be different, so check for length
Ah, I see..
I Thought that all A_n should be mappable to all B_m (not the same index)
Approved
Thank you :)
What is the format of bindings? From the fixed tests apparently each element is in the form of
(from_type, to_type)
, but it's not mentioned anywhere.It's mentioned at the end of the description (also the type
Set[Tuple[ADT, ADT]]
implies it, anyways). Should I rewrite to make it more clear?It's actually kind of ambiguous until
(from, to)
is mentioned. Also putting this information at where it is right now is kind of sub-optimal since it's very easy to miss it.I updated the description to give an example of binding set. I hope it's more clear now :)