Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F67040579
container.js
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Jun 19, 14:09
Size
647 B
Mime Type
text/x-java
Expires
Fri, Jun 21, 14:09 (2 d)
Engine
blob
Format
Raw Data
Handle
18322468
Attached To
R2664 SHRINE MedCo Fork
container.js
View Options
import * as _ from 'ramda';
export class Container {
constructor(f) {
this.__value = f;
}
static of(value) {
return new Container(() => value);
}
get value() {
return this.__value();
}
map(f) {
return this.hasNothing() ? Container.of(null) : Container.of(f(this.value));
}
join() {
return this.hasNothing()? Container.of(null) : this.value;
}
chain(f) {
return this.map(f).join();
}
hasNothing() {
return this.value === null || this.value === undefined;
}
ap(otherContainer) {
otherContainer.map(this.value);
}
}
Event Timeline
Log In to Comment