mattbierner / akh-codensity Goto Github PK
View Code? Open in Web Editor NEWAkh codensity monad
License: MIT License
Akh codensity monad
License: MIT License
I was experimenting with this (potentially nonsensical operation):
const State = require('akh').State
State.of('a').concat(State.of('b')).run('c')
and got:
ReferenceError: Codensity is not defined
at Object.k [as f] (/project/node_modules/akh.codensity/trans/codensity.js:37:22)
which is occurring here:
spec.Monoid(Instance,
new Instance(_ => m.zero),
function (b) {
return new Instance(k =>
Codensity.runCodensity(this, k)
.concat(Codensity.runCodensity(b, k)))
})
in file
https://github.com/mattbierner/akh-codensity/blob/master/trans/codensity.js
I can't say I understand exactly what a codensity is yet (need to work my way through https://www.maths.ed.ac.uk/~tl/sydney/sydney_talk.pdf !) but is Codensity
expected to be a value here?
Unless this code relies on Codensity
being somehow available in the global scope (which to my understanding wouldn't be true in strict mode, for example), this looks like it'll always throw this exception, regardless of the validity of the instigating code.
Maybe I'm missing something, but does this work as intended, or is it a bug to reference Codensity
without requiring it?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.