UNPKG
@typed/lenses
Version:
latest (4.1.1)
4.1.1
4.1.0
4.0.0
3.0.0
2.3.0
2.2.0
2.1.0
2.0.0
1.1.0
1.0.0
Strongly-typed functional lenses
@typed/lenses
/
source
/
pipe2.ts
9 lines
(7 loc)
•
224 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
9
import
{
Lens
}
from
'./Lens'
export
function
pipe2<A, B, C>(
ab
:
Lens
<A, B>,
bc
:
Lens
<B, C>):
Lens
<A, C> {
return
Lens
.
create
(
(
a
) =>
bc.
get
(ab.
get
(a)),
(
c, a
) =>
ab.
update
(
(
b
) =>
bc.
update
(
() =>
c, b), a), ) }