Skip to content

Commit a5556b3

Browse files
authored
Bump to Fable 3.1.15 (#434)
1 parent 2fee409 commit a5556b3

File tree

15 files changed

+79
-59
lines changed

15 files changed

+79
-59
lines changed

.config/dotnet-tools.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
]
1616
},
1717
"fable": {
18-
"version": "3.0.4",
18+
"version": "3.1.15",
1919
"commands": [
2020
"fable"
2121
]

src/FSharpPlus/Control/Applicative.fs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ type Apply =
2222
static member ``<*>`` (f: Lazy<'T->'U> , x: Lazy<'T> , [<Optional>]_output: Lazy<'U> , [<Optional>]_mthd: Apply) = Lazy.apply f x : Lazy<'U>
2323
static member ``<*>`` (f: seq<_> , x: seq<'T> , [<Optional>]_output: seq<'U> , [<Optional>]_mthd: Apply) = Seq.apply f x : seq<'U>
2424
static member ``<*>`` (f: NonEmptySeq<_> , x: NonEmptySeq<'T> , [<Optional>]_output: NonEmptySeq<'U> , [<Optional>]_mthd: Apply) = NonEmptySeq.apply f x : NonEmptySeq<'U>
25-
#if !FABLE_COMPILER
2625
static member ``<*>`` (f: IEnumerator<_> , x: IEnumerator<'T> , [<Optional>]_output: IEnumerator<'U> , [<Optional>]_mthd: Apply) = Enumerator.map2 id f x : IEnumerator<'U>
27-
#endif
2826
static member ``<*>`` (f: list<_> , x: list<'T> , [<Optional>]_output: list<'U> , [<Optional>]_mthd: Apply) = List.apply f x : list<'U>
2927
static member ``<*>`` (f: _ [] , x: 'T [] , [<Optional>]_output: 'U [] , [<Optional>]_mthd: Apply) = Array.apply f x : 'U []
3028
static member ``<*>`` (f: 'r -> _ , g: _ -> 'T , [<Optional>]_output: 'r -> 'U , [<Optional>]_mthd: Apply) = fun x -> let f' = f x in f' (g x) : 'U
@@ -75,9 +73,7 @@ type Lift2 =
7573
static member Lift2 (f, (x: Lazy<_> , y: Lazy<_> ), _mthd: Lift2) = Lazy.map2 f x y
7674
static member Lift2 (f, (x: seq<_> , y: seq<_> ), _mthd: Lift2) = Seq.lift2 f x y
7775
static member Lift2 (f, (x: NonEmptySeq<_> , y: NonEmptySeq<_> ), _mthd: Lift2) = NonEmptySeq.lift2 f x y
78-
#if !FABLE_COMPILER
7976
static member Lift2 (f, (x: IEnumerator<_> , y: IEnumerator<_> ), _mthd: Lift2) = Enumerator.map2 f x y
80-
#endif
8177
static member Lift2 (f, (x , y ), _mthd: Lift2) = List.lift2 f x y
8278
static member Lift2 (f, (x , y ), _mthd: Lift2) = Array.lift2 f x y
8379
static member Lift2 (f, (x: 'R -> 'T , y: 'R -> 'U ), _mthd: Lift2) = fun a -> f (x a) (y a)
@@ -116,9 +112,7 @@ type Lift3 =
116112
static member Lift3 (f, (x: Lazy<_> , y: Lazy<_> , z: Lazy<_> ), _mthd: Lift3) = Lazy.map3 f x y z
117113
static member Lift3 (f, (x: seq<_> , y: seq<_> , z: seq<_> ), _mthd: Lift3) = Seq.lift3 f x y z
118114
static member Lift3 (f, (x: NonEmptySeq<_> , y: NonEmptySeq<_> , z: NonEmptySeq<_> ), _mthd: Lift3) = NonEmptySeq.lift3 f x y z
119-
#if !FABLE_COMPILER
120115
static member Lift3 (f, (x: IEnumerator<_> , y: IEnumerator<_> , z: IEnumerator<_> ), _mthd: Lift3) = Enumerator.map3 f x y z
121-
#endif
122116
static member Lift3 (f, (x , y , z ), _mthd: Lift3) = List.lift3 f x y z
123117
static member Lift3 (f, (x , y , z ), _mthd: Lift3) = Array.lift3 f x y z
124118
static member Lift3 (f, (x: 'R -> 'T , y: 'R -> 'U , z: 'R -> 'V ), _mthd: Lift3) = fun a -> f (x a) (y a) (z a)

src/FSharpPlus/Control/Functor.fs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,7 @@ type Map with
119119

120120
static member Map ((x: seq<_> , f: 'T->'U), _mthd: Default2) = Seq.map f x : seq<'U>
121121
static member Map ((x: NonEmptySeq<_> , f: 'T->'U), _mthd: Default2) = NonEmptySeq.map f x : NonEmptySeq<'U>
122-
#if !FABLE_COMPILER
123122
static member Map ((x: IEnumerator<_> , f: 'T->'U), _mthd: Default2) = Enumerator.map f x : IEnumerator<'U>
124-
#endif
125123
static member Map ((x: IDictionary<_,_> , f: 'T->'U), _mthd: Default2) = Dict.map f x : IDictionary<'Key,'U>
126124
static member Map ((x: IReadOnlyDictionary<_,_>, f: 'T->'U), _mthd: Default2) = IReadOnlyDictionary.map f x : IReadOnlyDictionary<'Key,_>
127125
static member Map ((x: IObservable<'T> , f: 'T->'U), _mthd: Default2) = Observable.map f x : IObservable<'U>
@@ -175,9 +173,7 @@ type Unzip =
175173
static member Unzip ((source: seq<'T * 'U> , _output: seq<'T> * seq<'U> ) , _mthd: Unzip ) = Map.Invoke fst source, Map.Invoke snd source
176174
static member Unzip ((source: NonEmptySeq<'T * 'U> , _output: NonEmptySeq<'T> * NonEmptySeq<'U> ) , _mthd: Unzip ) = Map.Invoke fst source, Map.Invoke snd source
177175

178-
#if !FABLE_COMPILER
179176
static member Unzip ((source: IEnumerator<'T * 'U> , _output: IEnumerator<'T> * ResizeArray<'U> ) , _mthd: Unzip ) = Map.Invoke fst source, Map.Invoke snd source
180-
#endif
181177
static member Unzip ((source: IDictionary<'Key, 'T * 'U> , _output: IDictionary<_,'T> * IDictionary<_,'U> ) , _mthd: Unzip ) = Dict.unzip source
182178
static member Unzip ((source: IReadOnlyDictionary<'Key,'T * 'U> , _output: IReadOnlyDictionary<_,'T> * IReadOnlyDictionary<_,'U>) , _mthd: Unzip ) = IReadOnlyDictionary.unzip source
183179
static member Unzip ((source: IObservable<'T * 'U> , _output: IObservable<'T> * ResizeArray<'U> ) , _mthd: Unzip ) = Map.Invoke fst source, Map.Invoke snd source
@@ -194,9 +190,7 @@ type Unzip =
194190

195191
type Zip =
196192
inherit Default1
197-
#if !FABLE_COMPILER
198193
static member Zip ((x: IEnumerator<'T> , y: IEnumerator<'U> , _output: IEnumerator<'T*'U> ), _mthd: Zip) = Enumerator.zip x y
199-
#endif
200194
static member Zip ((x: seq<'T> , y: seq<'U> , _output: seq<'T*'U> ), _mthd: Zip) = Seq.zip x y
201195
static member Zip ((x: NonEmptySeq<'T> , y: NonEmptySeq<'U> , _output: NonEmptySeq<'T*'U> ), _mthd: Zip) = NonEmptySeq.zip x y
202196
static member Zip ((x: IDictionary<'K, 'T> , y: IDictionary<'K,'U> , _output: IDictionary<'K,'T*'U> ), _mthd: Zip) = Dict.zip x y

src/FSharpPlus/Control/Monad.fs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,7 @@ type Return =
122122

123123
static member Return (_: seq<'a> , _: Default2) = fun x -> Seq.singleton x : seq<'a>
124124
static member Return (_: NonEmptySeq<'a>, _: Default2) = fun x -> NonEmptySeq.singleton x : NonEmptySeq<'a>
125-
#if !FABLE_COMPILER
126125
static member Return (_: IEnumerator<'a>, _: Default2) = fun x -> Enumerator.upto None (fun _ -> x) : IEnumerator<'a>
127-
#endif
128126
static member inline Return (_: 'R , _: Default1) = fun (x: 'T) -> Return.InvokeOnInstance x : 'R
129127
static member Return (_: Lazy<'a> , _: Return ) = fun x -> Lazy<_>.CreateFromValue x : Lazy<'a>
130128
#if !FABLE_COMPILER

src/FSharpPlus/Control/Numeric.fs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,7 @@ open FSharpPlus.Internals.Prelude
132132
type Zero =
133133
inherit Default1
134134

135-
#if !FABLE_COMPILER
136135
static member Zero (_: System.TimeSpan , _: Zero ) = System.TimeSpan ()
137-
#endif
138136
static member Zero (_: DmStruct , _: Zero ) = Unchecked.defaultof<DmStruct>
139137
static member Zero (_: list<'a> , _: Zero ) = [] : list<'a>
140138
static member Zero (_: option<'a> , _: Zero ) = None : option<'a>
@@ -146,11 +144,12 @@ type Zero =
146144
static member Zero (_: Set<'a> , _: Zero ) = Set.empty : Set<'a>
147145
static member Zero (_: Map<'a,'b> , _: Zero ) = Map.empty : Map<'a,'b>
148146

149-
static member inline Invoke () =
147+
static member inline Invoke () =
150148
let inline call_2 (a: ^a, b: ^b) = ((^a or ^b) : (static member Zero : _*_ -> _) b, a)
151149
let inline call (a: 'a) = call_2 (a, Unchecked.defaultof<'r>) : 'r
152150
call Unchecked.defaultof<Zero>
153151

152+
#if !FABLE_COMPILER
154153
type Zero with
155154
static member inline Zero (t: 't, _:Zero) : 't =
156155
let _f _ = Constraints.whenNestedTuple t : ('t1*'t2*'t3*'t4*'t5*'t6*'t7*'tr)
@@ -163,6 +162,7 @@ type Zero with
163162
let (t2: 't2) = Zero.Invoke ()
164163
let (t1: 't1) = Zero.Invoke ()
165164
Tuple<_,_,_,_,_,_,_,_> (t1, t2, t3, t4, t5, t6, t7, tr) |> retype : 't
165+
#endif
166166

167167
type Zero with
168168
static member inline Zero (_: Tuple<'a>, _: Zero) = Tuple<_> (Zero.Invoke ()) : Tuple<'a>
@@ -185,7 +185,9 @@ type Zero with
185185
#endif
186186
static member inline Zero (_: 'T->'Monoid , _: Zero) = (fun _ -> Zero.Invoke ()) : 'T->'Monoid
187187
static member inline Zero (_: Async<'a> , _: Zero) = let (v: 'a) = Zero.Invoke () in async.Return v
188+
#if !FABLE_COMPILER
188189
static member inline Zero (_: Expr<'a> , _: Zero) = let (v: 'a) = Zero.Invoke () in Expr.Cast<'a>(Expr.Value (v))
190+
#endif
189191
static member inline Zero (_: Lazy<'a> , _: Zero) = let (v: 'a) = Zero.Invoke () in lazy v
190192
static member Zero (_: Dictionary<'a,'b> , _: Zero) = Dictionary<'a,'b> ()
191193
static member Zero (_: ResizeArray<'a> , _: Zero) = ResizeArray () : ResizeArray<'a>
@@ -196,13 +198,9 @@ type Zero with
196198
static member inline Zero (_: ^R , _: Default5) = Implicit.Invoke 0 : ^R
197199

198200
static member Zero (_: seq<'a> , _: Default4) = Seq.empty : seq<'a>
199-
#if !FABLE_COMPILER
200201
static member Zero (_: IEnumerator<'a> , _: Default4) = FSharpPlus.Enumerator.Empty () : IEnumerator<'a>
201-
#endif
202202
static member Zero (_: IDictionary<'a,'b> , _: Default4) = Dictionary<'a,'b> () :> IDictionary<'a,'b>
203-
#if !FABLE_COMPILER
204203
static member Zero (_: IReadOnlyDictionary<'a,'b> , _: Default4) = Dictionary<'a,'b> () :> IReadOnlyDictionary<'a,'b>
205-
#endif
206204
static member inline Zero (_: 't , _: Default3) = (^t : (static member Empty: ^t) ()) : 't
207205

208206
static member inline Zero (_: 't , _: Default2) = FromInt32.InvokeOnInstance 0 : 't

src/FSharpPlus/Extensions/Enumerator.fs

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

3-
#if !FABLE_COMPILER
3+
#if !FABLE_COMPILER || FABLE_COMPILER_3
44

55
/// Additional operations on IEnumerator
66
[<RequireQualifiedAccess>]

src/FSharpPlus/Lens.fs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,18 @@ module Lens =
4747
/// <param name="optic">The prism.</param>
4848
/// <param name="source">The object.</param>
4949
/// <returns>The value (if any) the prism is targeting.</returns>
50-
let preview (optic: ('a -> Const<_,'b>) -> _ -> Const<_,'t>) (source: 's) : 'a option = source |> optic (fun x -> Const (FSharpPlus.Data.First (Some x))) |> Const.run |> First.run
50+
let preview (optic: ('a -> Const<_,'b>) -> _ -> Const<_,'t>) (source: 's) : 'a option = source |> optic (fun x -> Const (First (Some x))) |> Const.run |> First.run
5151

5252
/// <summary>Build a 'Lens' from a getter and a setter.</summary>
5353
/// <remarks>The lens should be assigned as an inline function of the free parameter, not a value, otherwise compiler will fail with a type constraint mismatch.</remarks>
5454
/// <param name="getter">The getter function.</param>
5555
/// <param name="setter">The setter function, having as first parameter the object and second the value to set.</param>
5656
/// <param name="f">The free parameter.</param>
57+
/// <param name="s"></param>
5758
/// <returns>The lens.</returns>
5859
let inline lens (getter: 's -> 'a) (setter: 's -> 'b -> 't) (f: 'a -> '``F<'b>``) = fun s -> setter s </Map.InvokeOnInstance/> f (getter s) : '``F<'t>``
5960

60-
#if !FABLE_COMPILER
61+
#if !FABLE_COMPILER // there are issues on Fable with Return.InvokeOnInstance
6162
/// <summary>Build a 'Prism' from a constructor and a getter.</summary>
6263
/// <remarks>The prism should be assigned as an inline function of the free parameter, not a value, otherwise compiler will fail with a type constraint mismatch.</remarks>
6364
/// <remarks>Using Result instead of Option to permit the types of 's and 't to differ.</remarks>
@@ -75,7 +76,7 @@ module Lens =
7576
/// <param name="f">The free parameter.</param>
7677
/// <returns>The prism.</returns>
7778
let inline prism' (constructor: 'b -> 's) (getter: 's -> Option<'a>) (f: 'a -> '``F<'b>``) = prism constructor (fun s -> option Ok (Error s) (getter s)) f : 's -> '``F<'t>``
78-
#endif
79+
#endif
7980

8081
/// <summary>Build an 'Iso' from a pair of inverse functions.</summary>
8182
/// <param name="func">The transform function.</param>
@@ -155,8 +156,8 @@ module Lens =
155156
/// Lens for the value inside an Option or the given default value if the Option is None. Works well when combined with Map._item
156157
let inline non def f ma = Map.InvokeOnInstance (fun a' -> if a' = def then None else Some(a')) (f (Option.defaultValue def ma))
157158

158-
#if !FABLE_COMPILER
159159
// Prism
160+
#if !FABLE_COMPILER // there are issues on Fable with Return.InvokeOnInstance for prism 'Const First'
160161

161162
/// Prism providing a Traversal for targeting the 'Ok' part of a Result<'T,'Error>
162163
let inline _Ok x = (prism Ok <| either Ok (Error << Error)) x
@@ -169,7 +170,7 @@ module Lens =
169170

170171
/// Prism providing a Traversal for targeting the 'None' part of an Option<'T>
171172
let inline _None x = (prism' (konst None) <| option (konst None) (Some ())) x
172-
#endif
173+
#endif
173174

174175
// Traversal
175176
let inline _all ref f s =
@@ -239,13 +240,11 @@ module Lens =
239240
/// <returns>The new object with the value modified.</returns>
240241
let (%->) lens updater = over lens updater : 's -> 't
241242

242-
#if !FABLE_COMPILER
243243
/// <summary>Retrieve the first value targeted by a Prism, Fold or Traversal (or Some result from a Getter or Lens). Same as ``preview`` but with the arguments flipped.</summary>
244244
/// <param name="prism">The prism.</param>
245245
/// <param name="source">The object.</param>
246246
/// <returns>The value (if any) the prism is targeting.</returns>
247247
let (^?) (source: 's) (prism: ('a -> Const<_,'b>) -> _ -> Const<_,'t>) = preview prism source
248-
#endif
249248

250249
/// Extract a list of the targets of a Fold. Same as ``toListOf`` but with the arguments flipped.
251250
let (^..) s l = toListOf l s

tests/FSharpPlusFable.Tests/FSharpPlusFable.Tests.fsproj

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,17 @@
2323
<Compile Include="FSharpTests/General/Indexable.fs" />
2424
<Compile Include="FSharpTests/General/Parsing.fs" />
2525
<Compile Include="FSharpTests/General/Traversable.fs" />
26-
<Compile Include="FSharpTests\General\Lensing.fs" />
26+
<Compile Include="FSharpTests/General/Lensing.fs" />
27+
<Compile Include="FSharpTests/General/Numeric.fs" />
2728
<Compile Include="FSharpTests/General.fs" />
2829
<Compile Include="FSharpTests/Extensions.fs" />
2930
<Compile Include="Tests.fs" />
3031
</ItemGroup>
3132

3233

3334
<ItemGroup>
34-
<PackageReference Include="Fable.Core" Version="3.1.6" />
35-
<PackageReference Include="Fable.Promise" Version="2.1.0" />
35+
<PackageReference Include="Fable.Core" Version="3.2.5" />
36+
<PackageReference Include="Fable.Promise" Version="2.2.0" />
3637
<PackageReference Include="Fable.Fetch" Version="2.2.0" />
3738
<PackageReference Include="Fuchu" Version="1.2.0-beta-1" />
3839
</ItemGroup>
@@ -41,6 +42,6 @@
4142
<ProjectReference Include="..\..\src\FSharpPlus\FSharpPlus.fsproj">
4243
<Private>True</Private>
4344
</ProjectReference>
44-
<PackageReference Update="FSharp.Core" Version="4.6.2" />
45+
<PackageReference Update="FSharp.Core" Version="5.0.1" />
4546
</ItemGroup>
4647
</Project>

tests/FSharpPlusFable.Tests/FSharpTests/Extensions.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ let ExtensionsTest =
7979
#if FABLE_COMPILER && !FABLE_COMPILER_FAKE
8080
testCase "eq on DList 5" (fun () -> equal true ((dlistA :> obj) = (dlistD :> obj))) // this behavior differs from (non-fable) F# but same way it would be with normal lists.
8181
#endif
82-
#if !FABLE_COMPILER || FABLE_COMPILER_3
82+
#if !FABLE_COMPILER
8383
testCase "semigroups 1"
8484
(fun () ->
8585
let lzy1 = plus (lazy [1]) (lazy [2;3])

tests/FSharpPlusFable.Tests/FSharpTests/General.fs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ let idiomBrackets = testList "IdiomBrackets" [
6666
Assert.AreEqual ("outerinner", string output)
6767
Assert.AreEqual (4, v4))
6868
#endif
69-
]
69+
]
7070

7171
type RErrors = | NegativeValue
7272

@@ -156,7 +156,7 @@ let monadTransformers = testList "MonadTransformers" [
156156
equal (Error NegativeValue) y)
157157
#endif
158158
#endif
159-
]
159+
]
160160

161161
#if !FABLE_COMPILER || FABLE_COMPILER_3
162162
module ProfunctorDefaults =
@@ -203,7 +203,7 @@ let invariant = testList "Invariant" [
203203
Assert.AreEqual (Result<int, string>.Ok 1, oneParsed)
204204
Assert.AreEqual ("10", tenEncoded))
205205
#endif
206-
]
206+
]
207207

208208
type Sum<'a> = Sum of 'a with
209209
static member inline get_Zero () = Sum 0
@@ -252,7 +252,7 @@ let splits = testList "Splits" [
252252
// Assert.IsTrue((c = Sum 13))
253253
Assert.IsTrue((d = Sum 13)))
254254
#endif
255-
]
255+
]
256256

257257
let bitConverter = testList "BitConverter" [
258258
#if !FABLE_COMPILER
@@ -277,7 +277,7 @@ let bitConverter = testList "BitConverter" [
277277
Assert.IsTrue ((h0 = (h0 |> toBytes |> ofBytes)))
278278
Assert.IsTrue ((i0 = (i0 |> toBytes |> ofBytes))))
279279
#endif
280-
]
280+
]
281281

282282

283283
let curry = testList "Curry" [
@@ -330,7 +330,7 @@ let curry = testList "Curry" [
330330

331331
())
332332
#endif
333-
]
333+
]
334334

335335

336336
let memoization = testList "Memoization" [
@@ -379,7 +379,7 @@ let memoization = testList "Memoization" [
379379
let _ = mf null null // should not throw
380380
())
381381
#endif
382-
]
382+
]
383383

384384
open General.Alternative
385385
open General.Applicative
@@ -392,6 +392,7 @@ open General.Monoid
392392
open General.Parsing
393393
open General.Traversable
394394
open General.Lensing
395+
open General.Numeric
395396

396397
let generalTests = testList "General" [
397398
idiomBrackets
@@ -411,4 +412,5 @@ let generalTests = testList "General" [
411412
parsing
412413
traversable
413414
lensing
415+
numeric
414416
]

0 commit comments

Comments
 (0)