Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F73199931
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
Fri, Jul 19, 13:02
Size
647 B
Mime Type
text/x-java
Expires
Sun, Jul 21, 13:02 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
19160740
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