Skip to content

Commit 7c3b390

Browse files
committed
Add dummy overload for map
1 parent d26ae62 commit 7c3b390

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/FSharpPlus/Control/Functor.fs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,8 @@ type Map with
128128
and '``Applicative<'T->'U>`` : (static member Return : ('T -> 'U) -> '``Applicative<'T->'U>``)
129129
, f: 'T->'U), [<Optional>]_mthd: Default3) = Apply.InvokeOnInstance (Return.InvokeOnInstance f: '``Applicative<'T->'U>``) x : '``Applicative<'U>``
130130

131-
static member Map ((x: seq<_> , f: 'T->'U), _mthd: Default2) = Seq.map f x : seq<'U>
131+
static member Map ((x: seq<_> , f: 'T->'U), _mthd: Default2) = Seq.map f x : seq<'U>
132+
static member Map ((x: NonEmptySeq2<'T'> , f: 'T->'U), _mthd: Default2) = failwith "no Map implementation for NonEmptySeq2<'U>" : NonEmptySeq2<'U>
132133
static member Map ((x: IEnumerator<_> , f: 'T->'U), _mthd: Default2) = Enumerator.map f x : IEnumerator<'U>
133134
static member Map ((x: IDictionary<_,_> , f: 'T->'U), _mthd: Default2) = Dict.map f x : IDictionary<'Key,'U>
134135
static member Map ((x: IReadOnlyDictionary<_,_>, f: 'T->'U), _mthd: Default2) = IReadOnlyDictionary.mapValues f x : IReadOnlyDictionary<'Key,_>

src/FSharpPlus/Internals.fs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,10 @@ end
125125
[<Sealed>]
126126
type Set2<'T when 'T: comparison >() = class end
127127

128+
type NonEmptySeq2<'T> =
129+
inherit System.Collections.Generic.IEnumerable<'T>
130+
abstract member First: 'T
131+
128132
// BitConverter
129133

130134
#nowarn "9"

0 commit comments

Comments
 (0)