PrimeIntellect/SWE-rebench-V2-Filtered-Easy-Verified huggingface dataset:
Repository: vaskoz/dailycodingproblem-go (go)
Issue: Day 5
Good morning! Here's your coding interview problem for today.

This problem was asked by Jane Street.

`cons(a, b)` constructs a pair, and `car(pair)` and `cdr(pair)` returns the first and last element of that pair. For example, `car(cons(3, 4))` returns 3, and `cdr(cons(3, 4))` returns 4.

Given this implementation of cons:
```
def cons(a, b):
    def pair(f):
        return f(a, b)
    return pair
```

Implement car and cdr.
Pull request description: Day5
Resolves #9 

Patch:
diff --git a/README.md b/README.md
index 338a3df..29f92b7 100644
--- a/README.md
+++ b/README.md
@@ -13,4 +13,5 @@ problems from
 * [Day 2](https://github.com/vaskoz/dailycodingproblem-go/issues/3)
 * [Day 3](https://github.com/vaskoz/dailycodingproblem-go/issues/7)
 * [Day 4](https://github.com/vaskoz/dailycodingproblem-go/issues/5)
+* [Day 5](https://github.com/vaskoz/dailycodingproblem-go/issues/9)
 
diff --git a/day5/problem.go b/day5/problem.go
new file mode 100644
index 0000000..d7394d5
--- /dev/null
+++ b/day5/problem.go
@@ -0,0 +1,29 @@
+package day5
+
+// PairOperator is a function that can operate on a pair and return a value.
+type PairOperator func(interface{}, interface{}) interface{}
+
+// PairFunc is a function that takes a PairOperator function as an argument and returns a value.
+type PairFunc func(PairOperator) interface{}
+
+// Cons is given by the problem.
+// Arguments a and b can be anything and returns a PairFunc.
+func Cons(a, b interface{}) PairFunc {
+	return func(f PairOperator) interface{} {
+		return f(a, b)
+	}
+}
+
+// Car invokes the PairFunc to operate on the pair and return the first value in the pair.
+func Car(pair PairFunc) interface{} {
+	return pair(func(a, b interface{}) interface{} {
+		return a
+	})
+}
+
+// Cdr invokes the PairFunc to operate on the pair and return the second value in the pair.
+func Cdr(pair PairFunc) interface{} {
+	return pair(func(a, b interface{}) interface{} {
+		return b
+	})
+}


Test patch:
diff --git a/day5/problem_test.go b/day5/problem_test.go
new file mode 100644
index 0000000..8dfc5d7
--- /dev/null
+++ b/day5/problem_test.go
@@ -0,0 +1,34 @@
+package day5
+
+import "testing"
+
+func TestCar(t *testing.T) {
+	t.Parallel()
+	result := Car(Cons(3, 4))
+	if result != 3 {
+		t.Errorf("Expected 3 but got %d", result)
+	}
+}
+
+func TestCdr(t *testing.T) {
+	t.Parallel()
+	result := Cdr(Cons(3, 4))
+	if result != 4 {
+		t.Errorf("Expected 4 but got %d", result)
+	}
+}
+
+// Pretty much just benchmarking function call performance.
+// Benchmarks just included for completeness, but not necessary.
+
+func BenchmarkCar(b *testing.B) {
+	for i := 0; i < b.N; i++ {
+		Car(Cons(3, 4))
+	}
+}
+
+func BenchmarkCdr(b *testing.B) {
+	for i := 0; i < b.N; i++ {
+		Cdr(Cons(3, 4))
+	}
+}
Repository: yargs/yargs (js)
Issue: Hidden option is not recognized
An option is not recognised when declared `hidden` by specifying a `falsy` describe.

```js
var yargs = require("yargs");

yargs
.strict()
.option('foo', { type: 'boolean', describe: false })
.parse(['node', 'my-script.js', '--foo']);

// "Unknown argument: foo"
```

```js
var yargs = require("yargs");

yargs
.strict()
.option('foo', { type: 'boolean', describe: 'Foo option' })
.parse(['node', 'my-script.js', '--foo']);

// { foo: true }
```

Am I missing something here?

Thanks!
Pull request description: fix: strict mode should not fail for hidden options
Address a bug @satazor found related to `strict()` mode firing for hidden options -- in the process I cleaned up strict mode logic for options a bit ... it seems like simply looking at the `aliases` map covers most of our bases.

fixes #948 

Patch:
diff --git a/lib/validation.js b/lib/validation.js
index f66c04f..0b322a3 100644
--- a/lib/validation.js
+++ b/lib/validation.js
@@ -120,26 +120,16 @@ module.exports = function validation (yargs, usage, y18n) {
 
   // check for unknown arguments (strict-mode).
   self.unknownArguments = function unknownArguments (argv, aliases, positionalMap) {
-    const aliasLookup = {}
-    const descriptions = usage.getDescriptions()
-    const demandedOptions = yargs.getDemandedOptions()
     const commandKeys = yargs.getCommandInstance().getCommands()
     const unknown = []
     const currentContext = yargs.getContext()
 
-    Object.keys(aliases).forEach((key) => {
-      aliases[key].forEach((alias) => {
-        aliasLookup[alias] = key
-      })
-    })
-
     Object.keys(argv).forEach((key) => {
       if (specialKeys.indexOf(key) === -1 &&
-        !descriptions.hasOwnProperty(key) &&
-        !demandedOptions.hasOwnProperty(key) &&
         !positionalMap.hasOwnProperty(key) &&
         !yargs._getParseContext().hasOwnProperty(key) &&
-        !aliasLookup.hasOwnProperty(key)) {
+        !aliases.hasOwnProperty(key)
+      ) {
         unknown.push(key)
       }
     })


Test patch:
diff --git a/test/validation.js b/test/validation.js
index 685d61d..b65c19f 100644
--- a/test/validation.js
+++ b/test/validation.js
@@ -724,6 +724,32 @@ describe('validation tests', () => {
             })
         .argv
     })
+
+    it('does not fail for hidden options', () => {
+      const args = yargs('--foo hey')
+        .strict()
+        .option('foo', {boolean: true, describe: false})
+        .fail((msg) => {
+          expect.fail()
+        })
+        .argv
+      args.foo.should.equal(true)
+    })
+
+    it('does not fail if an alias is provided, rather than option itself', () => {
+      const args = yargs('--cat hey')
+        .strict()
+        .option('foo', {boolean: true, describe: false})
+        .alias('foo', 'bar')
+        .alias('bar', 'cat')
+        .fail((msg) => {
+          expect.fail()
+        })
+        .argv
+      args.cat.should.equal(true)
+      args.foo.should.equal(true)
+      args.bar.should.equal(true)
+    })
   })
 
   describe('demandOption', () => {