From 4189fac2df1ccbf55e9a511d2d7ec3cdcb7a6ab7 Mon Sep 17 00:00:00 2001
From: Gus <1261319+gusty@users.noreply.github.com>
Date: Sun, 8 Feb 2026 21:30:36 +0100
Subject: [PATCH] Add (|!>) operators
These operators (|!>) and () and () is unary and it turns out it will be the most used of the 2, because it's in the direction of typical F# pipes.
---
src/FSharpPlus/Operators.fs | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/FSharpPlus/Operators.fs b/src/FSharpPlus/Operators.fs
index 00086cc06..84a1a0be2 100644
--- a/src/FSharpPlus/Operators.fs
+++ b/src/FSharpPlus/Operators.fs
@@ -174,6 +174,18 @@ module Operators =
/// Functor
let inline iter (action: 'T->unit) (source: '``Functor<'T>``) : unit = Iterate.Invoke action source
+ ///
+ /// Replaces a functor value with the supplied one, ignoring the original value.
+ ///
+ /// Functor
+ let inline (|!>) (source: '``Functor<'T>``) (value: 'U) : '``Functor<'U>`` = Map.Invoke (fun _ -> value) source
+
+ ///
+ /// Replaces a functor value with the supplied one, ignoring the original value.
+ ///
+ /// Functor
+ let inline (``) : '``Functor<'U>`` = Map.Invoke (fun _ -> value) source
+
///
/// Un-zips (un-tuple) two functors.
///