Skip to content

Commit

Permalink
+ "Deep map" pipe operators
Browse files Browse the repository at this point in the history
  • Loading branch information
gusty authored Jan 25, 2024
1 parent 88fd94c commit 3eaa3c8
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/FSharpPlus/Operators.fs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,19 @@ module Operators =
/// <category index="1">Functor</category>
let inline (|>>) (x: '``Functor<'T>``) (f: 'T->'U) : '``Functor<'U>`` = Map.Invoke f x

/// <summary>
/// Lifts a function into two Functors.
/// To be used in pipe-forward style expressions
/// </summary>
/// <category index="1">Functor</category>
let inline (|>>>) (x: '``Functor1<Functor2<'T>>``) (f: 'T -> 'U) : '``Functor1<Functor2<'U>>`` = (Map.Invoke >> Map.Invoke) f x

/// <summary>
/// Lifts a function into two Functors.
/// </summary>
/// <category index="1">Functor</category>
let inline (<<<|) (f: 'T -> 'U) (x: '``Functor1<Functor2<'T>>``) : '``Functor1<Functor2<'U>`` = (Map.Invoke >> Map.Invoke) f x

/// <summary>
/// Like map but ignoring the results.
/// </summary>
Expand Down

0 comments on commit 3eaa3c8

Please sign in to comment.