Skip to content

Commit

Permalink
Ambiguate keyValuePair
Browse files Browse the repository at this point in the history
  • Loading branch information
gusty committed Nov 25, 2023
1 parent ee0f250 commit 25baab4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/FSharpPlus/Control/Applicative.fs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ type Apply =
static member ``<*>`` ((f: Result<_,'E> , x: Result<'T,'E> , _output: Result<'b,'E> ) , [<Optional>]_mthd: Apply) = Result.apply f x : Result<'U,'E>
static member ``<*>`` ((f: Choice<_,'E> , x: Choice<'T,'E> , _output: Choice<'b,'E> ) , [<Optional>]_mthd: Apply) = Choice.apply f x : Choice<'U,'E>
static member inline ``<*>`` ((KeyValue(a: 'Key, f), KeyValue(b: 'Key, x: 'T), _output: KeyValuePair<'Key,'U>), [<Optional>]_mthd: Apply) : KeyValuePair<'Key,'U> = KeyValuePair (Plus.Invoke a b, f x)
static member inline ``<*>`` ((f: KeyValuePair2<'Key, _>, x: KeyValuePair2<'Key, 'T>, _output: KeyValuePair2<'Key,'U>), [<Optional>]_mthd: Apply) : KeyValuePair2<'Key,'U> =
let a = f.Key
let b = x.Key
let f = f.Value
let x = x.Value
KeyValuePair2 (Plus.Invoke a b, f x)

static member ``<*>`` ((f: Map<'Key,_> , x: Map<'Key,'T> , _output: Map<'Key,'U> ) , [<Optional>]_mthd: Apply) : Map<'Key,'U> = Map (seq {
for KeyValue(k, vf) in f do
Expand Down
6 changes: 6 additions & 0 deletions src/FSharpPlus/Internals.fs
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,12 @@ type Either<'t,'u> =

type DmStruct = struct end

type KeyValuePair2<'TKey, 'TValue> = struct
val Key : 'TKey
val Value : 'TValue
new (key, value) = { Key = key; Value = value }
end

[<Sealed>]
type Set2<'T when 'T: comparison >() = class end

Expand Down

0 comments on commit 25baab4

Please sign in to comment.