Retired
truth tables (retired)
Loading description...
Algorithms
Booleans
Data Types
Parsing
Logic
Strings
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.
Please:
Test.assertDeepEquals
This list is not intended to be complete. But it would be a start.
Oh, and
eval
is not a good idea. Never. Nor is stringifying everything. ( Maybe just pass functions instead of strings? They're first class citizens, you know? )thanks for your feedback. I assume not using eval is good practise because it's not available in some languages?
Its unavailability is a good point. A Haskell translation would require a parser / evaluator, because there is no
eval
.But the usual reason is (a) speed and (b) security ( not necessarily in that order ).
eval
is necessarily slow, because things have to be done at runtime instead of at compiletime, and very much a security risk. Imagine you'd pass"format C:"
instead of"a&&b"
.. and you could, you know. :P Writing a parser / evaluator would be the safe option for production code, but that would be quite the project. Better to just generate([a,b]) => a && b
and pass that. ( JS could probably format your harddrive in a function, but in Haskell, that would be actually impossible [ for a pure function. and you can force purity ]. )Hmmm .. that parser / evaluator would not even be that much of a project. And it would be ( my ) kind of fun.
Tell you what, you redo the JavaScript kata, I'll do the Haskell translation. :]
There's
unsafePerformIO
and functions written in other languages can be called too. There's enough real-world stuff in Haskell to shoot yourself in a foot when you really want to.Oh man, that reminds me of a certain solution in the linear egg kata...
Please, as usual, actually finish writing a kata before publish it. There's no point publishing a half-completed kata.
This ^
The idea is good, the execution less than brilliant, the parts that at least are there. ( reinventing
===
aseq
? really ?!? )The only points a half-completed kata will score are negative, in the form of ratings.