Skip to content

Commit 52467f7

Browse files
committed
Merge remote-tracking branch 'origin/master' into v1.5
2 parents 71c323a + 1a5e595 commit 52467f7

File tree

6 files changed

+35
-13
lines changed

6 files changed

+35
-13
lines changed

RELEASE_NOTES.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
#### 1.5.0 - October 15 2023
2+
- Support for Fable 4 (some functions had to be removed from Fable in order to it)
3+
- More IList and IReadOnlyList functions
4+
- Bug fixes in parse, tryParse, seq's TryFinally and (=>>) for ValueTask
5+
- Add Free.hoist
6+
- Add distinct for NonEmptySeq and NonEmptyList
7+
- Add ValueOption.ofOption and Task.result for Task and ValueTask
8+
19
#### 1.4.0 - February 22 2023
210
- Additional Alternatives available (functions, error monads)
311
- More IReadOnlyDictionary functions

RELEASE_NOTES.txt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
Release Notes for FSharpPlus 1.4.0 - February 22 2023
1+
Release Notes for FSharpPlus 1.5.0 - October 15 2023
22
------------------------------------------------------
33

4-
Additional Alternatives available (functions, error monads)
5-
More IReadOnlyDictionary functions
6-
Bug fixes in Map as FoldIndexable and missing <*> for IDictionary and IReadOnlyDictionary
7-
Deprecate IReadOnlyDictionary.map
8-
Guid to/from bytes conversion
4+
Support for Fable 4 (some functions had to be removed from Fable in order to it)
5+
More IList and IReadOnlyList functions
6+
Bug fixes in parse, tryParse, seq's TryFinally and (=>>) for ValueTask
7+
Add Free.hoist
8+
Add distinct for NonEmptySeq and NonEmptyList
9+
Add ValueOption.ofOption and Task.result for Task and ValueTask

src/FSharpPlus/Control/Converter.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ type TryParse =
116116
match DateTime.TryParseExact (x, [|"yyyy-MM-ddTHH:mm:ss.fffZ"; "yyyy-MM-ddTHH:mm:ssZ"|], null, DateTimeStyles.RoundtripKind) with
117117
| true, x -> Some x
118118
| _ ->
119-
match DateTime.TryParse (x, CultureInfo.InvariantCulture, DateTimeStyles.None) with
119+
match DateTime.TryParse (x, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal) with
120120
| true, x -> Some x
121121
| _ -> None
122122

@@ -164,7 +164,7 @@ type Parse =
164164
static member Parse (_: DateTime , _: Parse) = fun (x:string) ->
165165
match DateTime.TryParseExact (x, [|"yyyy-MM-ddTHH:mm:ss.fffZ"; "yyyy-MM-ddTHH:mm:ssZ"|], null, DateTimeStyles.RoundtripKind) with
166166
| true, x -> x
167-
| _ -> DateTime.Parse (x, CultureInfo.InvariantCulture)
167+
| _ -> DateTime.Parse (x, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal)
168168

169169
static member Parse (_: DateTimeOffset, _: Parse) = fun (x:string) ->
170170
try DateTimeOffset.ParseExact (x, [|"yyyy-MM-ddTHH:mm:ss.fffK"; "yyyy-MM-ddTHH:mm:ssK"|], null, DateTimeStyles.AssumeUniversal)

src/FSharpPlus/Extensions/IList.fs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
namespace FSharpPlus
22

3-
#if !FABLE_COMPILER
43

54
/// Additional operations IList<'T>
65
[<RequireQualifiedAccess>]
@@ -9,9 +8,17 @@ module IList =
98
open System.Collections.ObjectModel
109
open System.Collections.Generic
1110

11+
#if !FABLE_COMPILER
1212
/// <summary>Converts an IList to an IReadOnlyList (from System.Collections.Generic).</summary>
1313
/// <param name="source">The System.Collections.Generic.IList</param>
1414
/// <returns>The list converted to a System.Collections.Generic.IReadOnlyList</returns>
1515
let toIReadOnlyList (source: IList<_>) = ReadOnlyCollection source :> IReadOnlyList<_>
1616

1717
#endif
18+
19+
let ofArray (source: 'T[] ) = source :> IList<'T>
20+
let ofList (source: 'T list) = source |> Array.ofList :> IList<'T>
21+
let ofSeq (source: seq<'T>) = source |> Array.ofSeq :> IList<'T>
22+
let map mapping (source: IList<'T>) = Seq.map mapping source |> Seq.toArray :> IList<'U>
23+
let iter mapping (source: IList<'T>) = Seq.iter mapping source
24+

src/FSharpPlus/Extensions/IReadOnlyList.fs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ module IReadOnlyList =
88
#if !FABLE_COMPILER
99

1010
let ofArray (source: 'T array) = IList.toIReadOnlyList source
11+
let ofList (source: 'T list) = source |> Array.ofList |> IList.toIReadOnlyList
12+
let ofSeq (source: seq<'T>) = source |> Array.ofSeq |> IList.toIReadOnlyList
13+
1114
#endif
15+
1216
let toArray (source: IReadOnlyList<'T>) = Array.ofSeq source
1317

1418
#if !FABLE_COMPILER
@@ -19,8 +23,13 @@ module IReadOnlyList =
1923
if 0 <= i && i < source.Count then
2024
source |> Array.ofSeq |> setNth i value |> ofArray |> Some
2125
else None
26+
27+
let map mapping (source: IReadOnlyList<'T>) : IReadOnlyList<'U> = Seq.map mapping source |> Seq.toArray |> IList.toIReadOnlyList
28+
2229
#endif
2330

2431
let tryItem i (source: IReadOnlyList<_>) =
2532
if 0 <= i && i < source.Count then Some source.[i]
26-
else None
33+
else None
34+
35+
let iter mapping (source: IReadOnlyList<'T>) = Seq.iter mapping source

src/FSharpPlus/Operators.fs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,6 @@ module Operators =
186186
let inline lift2 (f: 'T->'U->'V) (x: '``Applicative<'T>``) (y: '``Applicative<'U>``) : '``Applicative<'V>`` = Lift2.Invoke f x y
187187

188188
[<System.Obsolete("Use lift2 instead.")>]
189-
/// <category index="2">Applicative</category>
190189
let inline liftA2 (f: 'T->'U->'V) (x: '``Applicative<'T>``) (y: '``Applicative<'U>``) : '``Applicative<'V>`` = lift2 f x y
191190

192191
/// <summary>
@@ -208,11 +207,9 @@ module Operators =
208207
let inline (<* ) (x: '``Applicative<'U>``) (y: '``Applicative<'T>``) : '``Applicative<'U>`` = ((fun (k: 'U) (_: 'T) -> k ) <!> x : '``Applicative<'T->'U>``) <*> y
209208

210209
[<System.Obsolete("Use flip (<*>) instead.")>]
211-
/// <category index="2">Applicative</category>
212210
let inline (<**>) (x: '``Applicative<'T>``) : '``Applicative<'T -> 'U>``->'``Applicative<'U>`` = flip (<*>) x
213211

214212
[<System.Obsolete("Use opt instead.")>]
215-
/// <category index="2">Applicative</category>
216213
let inline optional v = Some <!> v </Append.Invoke/> result None
217214

218215
/// <summary>

0 commit comments

Comments
 (0)