Skip to content

Commit bdfe1f2

Browse files
committed
Use DmStruct2
1 parent 64e91bd commit bdfe1f2

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

src/FSharpPlus/Control/Applicative.fs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,7 @@ type Apply =
3737
static member ``<*>`` ((f: Result<_,'E> , x: Result<'T,'E> ), _output: Result<'b,'E> , [<Optional>]_mthd: Apply) = Result.apply f x : Result<'U,'E>
3838
static member ``<*>`` ((f: Choice<_,'E> , x: Choice<'T,'E> ), _output: Choice<'b,'E> , [<Optional>]_mthd: Apply) = Choice.apply f x : Choice<'U,'E>
3939
static member inline ``<*>`` ((KeyValue(a: 'Key, f), KeyValue(b: 'Key, x: 'T)), _output: KeyValuePair<'Key,'U>, [<Optional>]_mthd: Default3) : KeyValuePair<'Key,'U> = KeyValuePair (Plus.Invoke a b, f x)
40-
static member inline ``<*>`` ((f: KeyValuePair2<'Key, _>, x: KeyValuePair2<'Key, 'T>), _output: KeyValuePair2<'Key,'U>, [<Optional>]_mthd: Default3) : KeyValuePair2<'Key,'U> =
41-
let a = f.Key
42-
let b = x.Key
43-
let f = f.Value
44-
let x = x.Value
45-
KeyValuePair2 (Plus.Invoke a b, f x)
40+
static member inline ``<*>`` ((_: DmStruct2<'Key, _>, _: DmStruct2<'Key, 'T>) , _output: DmStruct2<'Key,'U> , [<Optional>]_mthd: Default3) : DmStruct2<'Key,'U> = Unchecked.defaultof<DmStruct2<'Key,'U>>
4641

4742
static member ``<*>`` ((f: Map<'Key,_> , x: Map<'Key,'T> ) , _output: Map<'Key,'U> , [<Optional>]_mthd: Apply) : Map<'Key,'U> = Map (seq {
4843
for KeyValue(k, vf) in f do

src/FSharpPlus/Control/Functor.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ type Map =
8989
static member Map ((x: Result<_,'E> , f: 'T->'U), _mthd: Map) = Result.map f x
9090
static member Map ((x: Choice<_,'E> , f: 'T->'U), _mthd: Map) = Choice.map f x
9191
static member Map ((KeyValue(k, x) , f: 'T->'U), _mthd: Map) = KeyValuePair (k, f x)
92-
static member Map ((x: KeyValuePair2<_, _> , f: 'T->'U), _mthd: Map) = let k, x = x.Key, x.Value in KeyValuePair2 (k, f x)
92+
static member Map ((_: DmStruct2<'T, 'E> , _: 'T->'U), _mthd: Map) = Unchecked.defaultof<DmStruct2<'U, 'E>>
9393
static member Map ((x: Map<'Key,'T> , f: 'T->'U), _mthd: Map) = Map.map (const' f) x : Map<'Key,'U>
9494
static member Map ((x: Dictionary<_,_> , f: 'T->'U), _mthd: Map) = Dictionary.map f x : Dictionary<'Key,'U>
9595
#if !FABLE_COMPILER

src/FSharpPlus/Internals.fs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ type Either<'t,'u> =
124124
| Right of 'u
125125

126126
type DmStruct = struct end
127+
type DmStruct2<'T1, 'T2> = struct end
127128

128129
type KeyValuePair2<'TKey, 'TValue> = struct
129130
val Key : 'TKey

0 commit comments

Comments
 (0)