
Security News
Socket Releases Free Certified Patches for Critical vm2 Sandbox Escape
A critical vm2 sandbox escape can allow untrusted JavaScript to break isolation and execute commands on the host Node.js process.
@hanshi/array-typeclass
Advanced tools
A package providing type-class implentations such as monad and traversable to the native javascript array.
@hanshi/array-typeclassimport * as AT from '@hanshi/array-typeclass';
import { _ } from '@hanshi/prelude';
const add = (n: number) => n + 1;
console.log('fmap add [1,2,3,4,5] = ', AT.fmap(add, [1, 2, 3, 4, 5]));
const linear = (a: number, x: number, b: number) => a * x + b;
console.log(
'linear <$> [-1, 0, 1, 2] <*> [-2, -1, 0, 1, 2, 3] <*> [-1, 0, 1] = ',
AT.tie(
AT.tie(AT.fmap(linear, [-1, 0, 1, 2]), [-2, -1, 0, 1, 2, 3]),
[-1, 0, 1]
)
);
const liftedLinear = AT.lift(linear);
console.log(
'liftedLinear [-1, 0, 1, 2] [-2, -1, 0, 1, 2, 3] [-1, 0, 1] = ',
liftedLinear([-1, 0, 1, 2], [-2, -1, 0, 1, 2, 3], [-1, 0, 1])
);
const limitedLinear = (a: number, b: number) =>
AT.tie(AT.fmap(_(linear, a), [-2, -1, 0, 1, 2, 3, 4, 5]), AT.pure(b));
for (const i of [-1, 0, 1])
for (const j of [-2, 0, 3])
console.log(`limitedLinear(${i}, ${j})`, limitedLinear(i, j));
console.log(
'limitedLinear =<< [-1,0,1] <<= [-2, 0 ,3 ] = ',
AT.warp([-2, 3], AT.warp([-1, 1], limitedLinear))
);
console.log(
'limitedLinear =<< [-1,0,1] <<= [-2, 0 ,3 ] = ',
AT.warp([-1, 1], limitedLinear)(5)
);
FAQs
A package providing type-class implentations such as monad and traversable to the native javascript array.
The npm package @hanshi/array-typeclass receives a total of 7 weekly downloads. As such, @hanshi/array-typeclass popularity was classified as not popular.
We found that @hanshi/array-typeclass 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
A critical vm2 sandbox escape can allow untrusted JavaScript to break isolation and execute commands on the host Node.js process.

Research
Five malicious NuGet packages impersonate Chinese .NET libraries to deploy a stealer targeting browser credentials, crypto wallets, SSH keys, and local files.

Security News
pnpm 11 turns on a 1-day Minimum Release Age and blocks exotic subdeps by default, adding safeguards against fast-moving supply chain attacks.