Skip to content

Commit 25158ad

Browse files
committed
Merge remote-tracking branch 'origin/master' into v1.3
2 parents b7529ff + 50dbb7b commit 25158ad

File tree

6 files changed

+27
-7
lines changed

6 files changed

+27
-7
lines changed

RELEASE_NOTES.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
#### 1.3.3 - February 4 2023
1+
#### 1.3.3 - February 5 2023
22
- Fix missing zero overload for voption
3+
- Add (>>=) and (>=>) to ReaderT
4+
- Add ValueOption.toOption
5+
- Deprecate (<**>)
36

47
#### 1.3.2 - December 2 2022
58
- Applicative Computation Expressions

RELEASE_NOTES.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
Release Notes for FSharpPlus 1.3.3 - February 4 2023
1+
Release Notes for FSharpPlus 1.3.3 - February 5 2023
22
-----------------------------------------------------
33

4-
Fix missing zero overload for voption
4+
Fix missing zero overload for voption
5+
Add (>>=) and (>=>) to ReaderT
6+
Add ValueOption.toOption
7+
Deprecate (<**>)

src/FSharpPlus/Data/Reader.fs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,18 @@ type ReaderT<'r,'``monad<'t>``> with
155155
/// <category index="2">Applicative</category>
156156
static member inline (<* ) (x: ReaderT<'R, '``Monad<'U>``>, y: ReaderT<'R, '``Monad<'T>``>) : ReaderT<'R, '``Monad<'U>``> = ((fun (k: 'U) (_: 'T) -> k ) </ReaderT.map/> x : ReaderT<'R, '``Monad<'T->'U>``>) </ReaderT.apply/> y
157157

158+
/// <summary>
159+
/// Takes a Reader value and a function from a plain type to a Reader value, and returns a new Reader value.
160+
/// </summary>
161+
/// <category index="2">Monad</category>
158162
static member inline (>>=) (x: ReaderT<_,'``Monad<'T>``>, f: 'T->ReaderT<'R,'``Monad<'U>``>) = ReaderT.bind f x : ReaderT<'R, '``Monad<'U>``>
159-
163+
164+
/// <summary>
165+
/// Composes left-to-right two Reader functions (Kleisli composition).
166+
/// </summary>
167+
/// <category index="2">Monad</category>
168+
static member inline (>=>) (f: 'T -> ReaderT<_,'``Monad<'U>``>, g: 'U -> ReaderT<'R,'``Monad<'V>``>) : 'T -> ReaderT<'R,'``Monad<'V>``> = fun x -> ReaderT.bind g (f x)
169+
160170
static member inline get_Empty () = ReaderT (fun _ -> getEmpty ()) : ReaderT<'R, '``MonadPlus<'T>``>
161171
static member inline (<|>) (ReaderT m, ReaderT n) = ReaderT (fun r -> m r <|> n r) : ReaderT<'R, '``MonadPlus<'T>``>
162172

src/FSharpPlus/Extensions/Result.fs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ module Result =
7878
/// <remarks><c>flatten</c> is equivalent to <c>bind id</c>.</remarks>
7979
let flatten source : Result<'T,'Error> = match source with Ok (Ok v) -> Ok v | Ok (Error e) | Error e -> Error e
8080

81+
// Note: To be fixed in F#+ 2. Arguments should be flipped in order to match the generic catch.
8182
[<System.Obsolete("Use Result.bindError instead.")>]
8283
let inline catch f = function Ok v -> Ok v | Error e -> (f: 't->_) e : Result<'v,'e>
8384

src/FSharpPlus/Extensions/ValueOption.fs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,8 @@ module ValueOption =
7070
match pair with
7171
| true, x -> ValueSome x
7272
| false, _ -> ValueNone
73+
74+
let toOption x =
75+
match x with
76+
| ValueSome x -> Some x
77+
| ValueNone -> None

src/FSharpPlus/Operators.fs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,7 @@ module Operators =
207207
/// <category index="2">Applicative</category>
208208
let inline (<* ) (x: '``Applicative<'U>``) (y: '``Applicative<'T>``) : '``Applicative<'U>`` = ((fun (k: 'U) (_: 'T) -> k ) <!> x : '``Applicative<'T->'U>``) <*> y
209209

210-
/// <summary>
211-
/// Apply a lifted argument to a lifted function (flipped): arg &lt;**&gt; f
212-
/// </summary>
210+
[<System.Obsolete("Use flip (<*>) instead.")>]
213211
/// <category index="2">Applicative</category>
214212
let inline (<**>) (x: '``Applicative<'T>``) : '``Applicative<'T -> 'U>``->'``Applicative<'U>`` = flip (<*>) x
215213

0 commit comments

Comments
 (0)