@Fatalize If ẉ ignores its right argument, why doesn't the predicate inside {} in this program find just one valid integer and then generate more outputs with ẉ?
Is an unconstrained variable counted as a single output for the predicate or something?
I suppose it does. If I understand you correctly, the important thing is that ẉ does not create a choice point for its right argument, if it's not actually used for anything in the predicate.
The first one only prints one number because ḋ generates choice points (since its input is free) and so will bactrack on that first. If you ask for the output, you get your 9 results
The second one gives an error because of a new bug you discovered :)
@Zgarb I get the same behavior for ^ after fixing it. Basically this is because ṡ leaves two choice points: either its input is 0, and then its output is 0, or its input is not 0, and then its output is abs(input)/input
so because you ask for 9 answers, and since ṡ leaves two choice points, it will only backtrack up to ẉ 4 times, thus printing 5 numbers (including the first pass)
@Fatalize Actually he posted a message in chat that I had missed. He won't have much time for PPCG in the foreseeable future, so I'm effectively the sole maintainer of Husk for now.
@Fatalize what would be the "right" way to reuse the input? for example how could I write (i+2)*i, I was thinking in something like +₂×₂w but replacing the second ₂ with the input
@Fatalize We had thought about a Haskell-based golfing language independently, but I think Leo made the first push into actually implementing something and was looking for collaborators. (Montpellier is still covered in snow and pretty much paralyzed.)
Basically, ;? forms a pair of the current value and the input, and ḍ₎ means "evaluate ḍ on the left element of the pair, using the right element as a subscript".
@all I really like this new challenge and had found a really cool solution to it (which is shorter than the current 05AB1E answer). I'll let some time to people interested in solving it before answering though
it's also shorter than Dennis' Jelly answer, so if you want to reap some green points, start thinking :p
… well Erik just answered :p, but you can still find something shorter
@MartinEnder From experience, it's not clear it would be better. We often use it to constrain some free variable and need the input list right after it
I don't know how hard this would be to implement, but it seems like meta-predicates of the form "All elements of ? satisfy the predicate with ." and "Any element of ? satisfies the predicate with ." could be useful.
Brachylog, 10 bytes
=ᵍbᵐbᵐlᵍ=l
Try it online!
Explanation
=ᵍ Group all equal elements together
bᵐbᵐ Remove the first element of each group twice. This fails if
there are fewer than 2 elements
lᵍ Group elements together that have th...