![Maven Central Adds Sigstore Signature Validation](https://cdn.sanity.io/images/cgdhsj6q/production/7da3bc8a946cfb5df15d7fcf49767faedc72b483-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
1) Large flightless bird found in Fantasy Land
2) Javascript monad transformer library
$ npm install --save akh
Akh is a collection of monad and monad transformers that implement Fantasy Land's interfaces. It is inspired by Haskell's MTL.
Akh can either be used as a single library, or you can pick up individual types from split out libraries. See each library for more documentation on that type.
All functions from akh.core are top level exports.
const List = require('akh').List
const StateT = require('akh').StateT
// Define a new monad using the state transformer on the list monad.
const M = StateT(List)
// Define a way to pass values through `M`
const run = (c, state) => List.runList(StateT.runStateT(c, state))
// Create a simple stateful computation with an initial value
const start = M.of('porky')
// Run the stateful computation to get a list of
// value, state pairs
run(start, 'wackyland') === [
{ value: 'porky', state: 'wackyland' }
]
// Let's update the current state using a function
const modifiedState = start.modify(state => state.toUpperCase())
run(modifiedState, 'wackyland') === [
{ value: 'WACKYLAND', state: 'WACKYLAND' }
]
// Note that modify also updated the held value here. We could avoid that
// by instead writing
const modifiedState2 = start
.chain(currentValue =>
M.modify(state => state.toUpperCase())
.map(_ => currentValue))
run(modifiedState2, 'wackyland') === [
{ value: 'porky', state: 'WACKYLAND' }
]
// Now let's start using the list monad and branch the state.
const branched = modifiedState2
.concat(
M.put('nuts').map(_ => 100) // `put` sets the current state
)
.concat(
M.put('squirrel').map(_ => 1)
)
.concat(
M.get // gets the state
)
run(branched, 'wackyland') === [
{ value: 'porky', state: 'WACKYLAND' },
{ value: 100, state: 'nuts' },
{ value: 1, state: 'squirrel' },
{ value: 'wackyland', state: 'wackyland' }
]
// We can then operate on all states at the same time.
const doubled = branched.map(x => x + x)
run(doubled, 'wackyland') === [
{ value: 'porkyporky', state: 'WACKYLAND' },
{ value: 200, state: 'nuts' },
{ value: 2, state: 'squirrel' },
{ value: 'wackylandwackyland', state: 'wackyland' }
]
Improvement and additions to Akh are welcome. Please report any issues or send a pull request.
The Dodo Bird is a Looney Toons character created and owned by Warner Bros.
FAQs
Monad and Monad Transformer Collection
We found that akh 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
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.