@RadvylfPrograms i think it's sensible in a vacuum for Result to support any type for Err, for general Either-y use, but it's definitely a mistake for Error to exist and be usable for top-level errors
like if you want it to be possible for internal structured representations of errors to be punted arbitrarily far up, then just convert them to a string or such when you do that instead of encouraging fucking existential types
and yeah i think your idea of an identifier-description pair for the default/canonical representation of an error is hard to beat
In accordance with our meta agreement, since one candidate received more votes than the others, we have a new featured language! Throughout November 2022, our Language of the Month will be:
J
What's a Language of the Month?
See the meta post for nominations. In short, during November, those who...
Given a string of digits or an integer as input, you will have to indexize it.
This is how you modify the input. We will use 30043376111 as an example:
First, find the sum of the indices of each occurrence of the respective digits:
0: 1 + 2 = 3
1: 8 + 9 + 10 = 27
3: 0 + 4 + 5 = 9
4: 3
6: 7
7...
The Art of Word Shaping
Given a binary matrix and a string of letters, replace all 1's in the matrix, moving from top to bottom and from left to right within each row, with the letters of the string. Once the letters have been formed into the shape of the matrix, print the matrix, replacing 0's w...
@Razetime Sorry for the late reply. It's not anything in the standard library, where did you find it? It's probably a user-defined method, but most people don't make operators over 3 characters
If you know what library it is, they'll probably link to the docs for it. If you want the standard library, here's the 2.13 API and the 3.2.1 API
The idea is this: Write a function to print the length of time from now/today's date (at the time the function is called) until a date supplied as an argument.
Assumptions:
Input date will always be tomorrow or later, in the future.
Input date will never be more than 10 years in the future.
...
@RadvylfPrograms That seems unlikely, comparing functions doesn't really work in Scala (probably not most languages)
@RadvylfPrograms It's actually just def +(b: B) = ... to do a + b. You actually can't overload == though, since it's a final method that everything inherits (it's treated specially so that stuff like null == foo works)
ScalaTest does have ===, but the way they use it is absolutely abominable and would make even a Groovy programmer recoil in disgust
It's going to be really difficult to objectively determine if a graphical representation is correct enough
I'd really recommend leaving out the graphical output aspect
Or possibly allowing the program to take images of the building blocks as input
Actually I think the latter would probably be the best option
That way nobody needs to hardcode a font (or depend on an external one), no subjective judgements about the correctness of the output needs to be made, since it would conform to a strict spec given the same input images, and the challenge keeps its core challenge
I am planning on posing a fastest-code challenge to output a near repunit prime of every number of digits n starting at n = 2. So the highest n you can get to in 1 minute is your score
This challenge is inspired by the High throughput Fizz Buzz challenge.
The goal
Generate a list of prime numbers up to 10,000,000,000,000,000. The output of primes should be in decimal digits followed by a newline character '\n' in ascending order starting from the lowest prime 2. You may not ski...
@Sʨɠɠan another option is that a near repunit can be represented by three digits. The majority digit, the minority digit and the location of the minority (plus the number of digits if needed)
@Sʨɠɠan Thanks, I had to come back because I'm bored out of my mind and haven't made any friends so this is the only place I can get any social interaction :P