From 821b01d21b2e7e10012a041be6f8c78479ee9ba4 Mon Sep 17 00:00:00 2001 From: Gus <1261319+gusty@users.noreply.github.com> Date: Wed, 11 Jun 2025 07:16:08 +0200 Subject: [PATCH 1/2] ZipList implements IEnumerable's --- src/FSharpPlus/Data/ZipList.fs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/FSharpPlus/Data/ZipList.fs b/src/FSharpPlus/Data/ZipList.fs index e06b02f2e..2572111e6 100644 --- a/src/FSharpPlus/Data/ZipList.fs +++ b/src/FSharpPlus/Data/ZipList.fs @@ -5,10 +5,13 @@ open FSharpPlus /// A sequence with an Applicative functor based on zipping. -[] +[] type ZipList<'s> = ZipList of 's seq with member this.Item n = let (ZipList s) = this in Seq.item n s + interface IEnumerable<'s> with member x.GetEnumerator () = (let (ZipList x) = x in x).GetEnumerator () + interface System.Collections.IEnumerable with member x.GetEnumerator () = (let (ZipList x) = x in x).GetEnumerator () :> System.Collections.IEnumerator + /// Basic operations on ZipList [] module ZipList = From c37aea8ca762d9b149eb2855666e8075a2eb12a6 Mon Sep 17 00:00:00 2001 From: Gus <1261319+gusty@users.noreply.github.com> Date: Wed, 11 Jun 2025 07:33:09 +0200 Subject: [PATCH 2/2] Add missing namespace --- src/FSharpPlus/Data/ZipList.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/FSharpPlus/Data/ZipList.fs b/src/FSharpPlus/Data/ZipList.fs index 2572111e6..c2610ebc3 100644 --- a/src/FSharpPlus/Data/ZipList.fs +++ b/src/FSharpPlus/Data/ZipList.fs @@ -9,7 +9,7 @@ open FSharpPlus type ZipList<'s> = ZipList of 's seq with member this.Item n = let (ZipList s) = this in Seq.item n s - interface IEnumerable<'s> with member x.GetEnumerator () = (let (ZipList x) = x in x).GetEnumerator () + interface System.Collections.Generic.IEnumerable<'s> with member x.GetEnumerator () = (let (ZipList x) = x in x).GetEnumerator () interface System.Collections.IEnumerable with member x.GetEnumerator () = (let (ZipList x) = x in x).GetEnumerator () :> System.Collections.IEnumerator /// Basic operations on ZipList