You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/FSharpPlus/Control/Applicative.fs
-6Lines changed: 0 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -22,9 +22,7 @@ type Apply =
22
22
static member ``<*>`` (f:Lazy<'T->'U>,x:Lazy<'T>,[<Optional>]_output:Lazy<'U>,[<Optional>]_mthd:Apply)= Lazy.apply f x : Lazy<'U>
23
23
static member ``<*>`` (f:seq<_>,x:seq<'T>,[<Optional>]_output:seq<'U>,[<Optional>]_mthd:Apply)= Seq.apply f x : seq<'U>
24
24
static member ``<*>`` (f:NonEmptySeq<_>,x:NonEmptySeq<'T>,[<Optional>]_output:NonEmptySeq<'U>,[<Optional>]_mthd:Apply)= NonEmptySeq.apply f x : NonEmptySeq<'U>
25
-
#if!FABLE_COMPILER
26
25
static member ``<*>`` (f:IEnumerator<_>,x:IEnumerator<'T>,[<Optional>]_output:IEnumerator<'U>,[<Optional>]_mthd:Apply)= Enumerator.map2 id f x : IEnumerator<'U>
27
-
#endif
28
26
static member ``<*>`` (f:list<_>,x:list<'T>,[<Optional>]_output:list<'U>,[<Optional>]_mthd:Apply)= List.apply f x : list<'U>
29
27
static member ``<*>`` (f:_ [],x:'T [],[<Optional>]_output:'U [],[<Optional>]_mthd:Apply)= Array.apply f x : 'U []
30
28
static member ``<*>`` (f:'r ->_ ,g:_ ->'T ,[<Optional>]_output:'r ->'U ,[<Optional>]_mthd:Apply)=fun x ->letf' = f x in f' (g x): 'U
@@ -75,9 +73,7 @@ type Lift2 =
75
73
static memberLift2(f,(x:Lazy<_>,y:Lazy<_>),_mthd:Lift2)= Lazy.map2 f x y
76
74
static memberLift2(f,(x:seq<_>,y:seq<_>),_mthd:Lift2)= Seq.lift2 f x y
77
75
static memberLift2(f,(x:NonEmptySeq<_>,y:NonEmptySeq<_>),_mthd:Lift2)= NonEmptySeq.lift2 f x y
78
-
#if!FABLE_COMPILER
79
76
static memberLift2(f,(x:IEnumerator<_>,y:IEnumerator<_>),_mthd:Lift2)= Enumerator.map2 f x y
80
-
#endif
81
77
static memberLift2(f,(x ,y ),_mthd:Lift2)= List.lift2 f x y
82
78
static memberLift2(f,(x ,y ),_mthd:Lift2)= Array.lift2 f x y
83
79
static memberLift2(f,(x:'R ->'T ,y:'R ->'U ),_mthd:Lift2)=fun a -> f (x a)(y a)
@@ -116,9 +112,7 @@ type Lift3 =
116
112
static memberLift3(f,(x:Lazy<_>,y:Lazy<_>,z:Lazy<_>),_mthd:Lift3)= Lazy.map3 f x y z
117
113
static memberLift3(f,(x:seq<_>,y:seq<_>,z:seq<_>),_mthd:Lift3)= Seq.lift3 f x y z
118
114
static memberLift3(f,(x:NonEmptySeq<_>,y:NonEmptySeq<_>,z:NonEmptySeq<_>),_mthd:Lift3)= NonEmptySeq.lift3 f x y z
119
-
#if!FABLE_COMPILER
120
115
static memberLift3(f,(x:IEnumerator<_>,y:IEnumerator<_>,z:IEnumerator<_>),_mthd:Lift3)= Enumerator.map3 f x y z
121
-
#endif
122
116
static memberLift3(f,(x ,y ,z ),_mthd:Lift3)= List.lift3 f x y z
123
117
static memberLift3(f,(x ,y ,z ),_mthd:Lift3)= Array.lift3 f x y z
124
118
static memberLift3(f,(x:'R ->'T ,y:'R ->'U ,z:'R ->'V ),_mthd:Lift3)=fun a -> f (x a)(y a)(z a)
/// <summary>Build a 'Lens' from a getter and a setter.</summary>
53
53
/// <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>
/// <param name="setter">The setter function, having as first parameter the object and second the value to set.</param>
56
56
/// <param name="f">The free parameter.</param>
57
+
/// <param name="s"></param>
57
58
/// <returns>The lens.</returns>
58
59
let inlinelens(getter:'s ->'a)(setter:'s ->'b ->'t)(f:'a ->'``F<'b>``)=fun s -> setter s </Map.InvokeOnInstance/> f (getter s): '``F<'t>``
59
60
60
-
#if!FABLE_COMPILER
61
+
#if!FABLE_COMPILER// there are issues on Fable with Return.InvokeOnInstance
61
62
/// <summary>Build a 'Prism' from a constructor and a getter.</summary>
62
63
/// <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>
63
64
/// <remarks>Using Result instead of Option to permit the types of 's and 't to differ.</remarks>
@@ -75,7 +76,7 @@ module Lens =
75
76
/// <param name="f">The free parameter.</param>
76
77
/// <returns>The prism.</returns>
77
78
let inlineprism' (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
79
80
80
81
/// <summary>Build an 'Iso' from a pair of inverse functions.</summary>
///Lens for the value inside an Option or the given default value if the Option is None. Works well when combined with Map._item
156
157
let inline non def f ma =Map.InvokeOnInstance (fun a' ->if a' =def then None else Some(a'))(f (Option.defaultValue def ma))
157
158
158
-
#if !FABLE_COMPILER
159
159
//Prism
160
+
#if !FABLE_COMPILER //there are issues on Fable with Return.InvokeOnInstance for prism 'Const First'
160
161
161
162
///Prism providing a Traversal for targeting the 'Ok' part of a Result<'T,'Error>
162
163
let inline _Ok x =(prism Ok <|either Ok (Error << Error))x
@@ -169,7 +170,7 @@ module Lens =
169
170
170
171
///Prism providing a Traversal for targeting the 'None' part of an Option<'T>
171
172
let inline _None x =(prism' (konst None)<|option (konst None)(Some ()))x
172
-
#endif
173
+
#endif
173
174
174
175
//Traversal
175
176
let inline _all ref f s =
@@ -239,13 +240,11 @@ module Lens =
239
240
/// <returns>The new object with the value modified.</returns>
240
241
let(%->)lens updater = over lens updater : 's -> 't
241
242
242
-
#if!FABLE_COMPILER
243
243
/// <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>
244
244
/// <param name="prism">The prism.</param>
245
245
/// <param name="source">The object.</param>
246
246
/// <returns>The value (if any) the prism is targeting.</returns>
Copy file name to clipboardExpand all lines: tests/FSharpPlusFable.Tests/FSharpTests/Extensions.fs
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -79,7 +79,7 @@ let ExtensionsTest =
79
79
#if FABLE_COMPILER &&!FABLE_COMPILER_FAKE
80
80
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.
0 commit comments