![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
This is a javascript adaptation of the haskell package these which provides
a data structure containing either a value a
or a value b
or both, values a
and b
:
data These a b = This a
| That b
| These a b
var t = These.This(1)
t instanceof These // => true
Creates an instance containing the this
value 1
.
var t = These.That(2)
t instanceof These // => true
Creates an instance containing the that
value 2
.
var t = These(1, 2)
t instanceof These // => true
Creates an instance containg the this
value 1
and that
value 2
.
These.This(1).isThis // => true
These.That(1).isThis // => false
These.These(1).isThis // => false
The isThis
property is true for This
instances and false otherwise.
These.This(1).isThat // => false
These.That(1).isThat // => true
These.These(1).isThat // => false
The isThat
property is true for That
instances and false otherwise.
These.This(1).isThese // => false
These.That(1).isThese// => false
These.These(1).isThese // => true
The isThese
property is true for These
instances and false otherwise.
These.This('foo').get() // => 'foo'
These.That('bar').get() // => 'bar'
These.These('foo', 'bar') // => { _this: 'foo', _that: 'bar' }
The get
function returns the wrapped value(s). In case of These
the values are wrapped in an object.
These.This(val).these(f, g, h) // => f(val)
These.That(val).these(f, g, h) // => g(val)
These.These(val).these(f, g, h) // => h(val)
The these
function accepts 3 functions - one for each case - and applies the correct function to the wrapped value.
These.This('today').fromThese('sometime', 'somewhere') // => [ 'today', 'somewhere' ]
These.That('beijing').fromThese('sometime', 'somewhere') // => [ 'sometime', 'beijing' ]
These.These('today', 'beijing').fromThese('sometime', 'somewhere') // => [ 'today', 'beijing' ]
The these
function accepts two values as default values and combines them with the value(s) provided by the These
instance.
var add = function(x,y) { return x + y };
These.This(1).merge(add) // => 1
These.That(1).merge(add) // => 1
These.These(1,2).merge(add) // => 3
The merge
function accepts a binary to combine values from These
instances. The wrapped value is returned as-is for This
and That
.
var inc = function(x) { return x + 1 };
var dec = function(x) { return x - 1 };
These.This(1).mapThese(inc, dec) // => This { 2 }
These.That(2).mapThese(inc, dec) // => That { 1 }
These.These(1, 2).mapThese(inc, dec) // => These { 2, 1 }
The mapThese
acts as a bi-functor accepting two functions, which are applied accordingly.
fantasy land compatible. validated using fantasy-check
FAQs
js implementation of data.these
We found that data.these demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.