Skip to content

Commit

Permalink
Ambiguate keyValuePair
Browse files Browse the repository at this point in the history
  • Loading branch information
gusty committed Nov 22, 2023
1 parent d36cfab commit 8412408
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/FSharpPlus/Control/Applicative.fs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ open FSharpPlus.Internals
open FSharpPlus
open FSharpPlus.Data

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

type Apply =
inherit Default1
Expand Down Expand Up @@ -37,6 +42,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

0 comments on commit 8412408

Please sign in to comment.