Skip to content

Commit 3eaa3c8

Browse files
authored
+ "Deep map" pipe operators
1 parent 88fd94c commit 3eaa3c8

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/FSharpPlus/Operators.fs

+13
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,19 @@ module Operators =
143143
/// <category index="1">Functor</category>
144144
let inline (|>>) (x: '``Functor<'T>``) (f: 'T->'U) : '``Functor<'U>`` = Map.Invoke f x
145145

146+
/// <summary>
147+
/// Lifts a function into two Functors.
148+
/// To be used in pipe-forward style expressions
149+
/// </summary>
150+
/// <category index="1">Functor</category>
151+
let inline (|>>>) (x: '``Functor1<Functor2<'T>>``) (f: 'T -> 'U) : '``Functor1<Functor2<'U>>`` = (Map.Invoke >> Map.Invoke) f x
152+
153+
/// <summary>
154+
/// Lifts a function into two Functors.
155+
/// </summary>
156+
/// <category index="1">Functor</category>
157+
let inline (<<<|) (f: 'T -> 'U) (x: '``Functor1<Functor2<'T>>``) : '``Functor1<Functor2<'U>`` = (Map.Invoke >> Map.Invoke) f x
158+
146159
/// <summary>
147160
/// Like map but ignoring the results.
148161
/// </summary>

0 commit comments

Comments
 (0)