FSharpPlus


ZipList<'T>

This is a wrapper over seq<'T> which changes its applicative semantic to point-wise processing.

Examples

#r @"nuget: FSharpPlus"
open FSharpPlus
open FSharpPlus.Data

let seq1 = seq { 1..100000}
let seq2 = seq {10..100000}

let seq1_plus_seq2  = (+) <!> ZipList seq1 <*> ZipList seq2

open FSharpPlus.Math.Applicative

let seq1_plus_seq2' = ZipList seq1 .+. ZipList seq2
let arrCombined     = 10 *. ZipList seq1 .+. ZipList seq2 .- 5
let asMonoid        = result "Hello " </plus/> ZipList ["City"; "World"; "Sun"]

// try ZipList.run {the results}
namespace FSharpPlus
namespace FSharpPlus.Data
val seq1: int seq
Multiple items
val seq: sequence: 'T seq -> 'T seq

--------------------
type 'T seq = System.Collections.Generic.IEnumerable<'T>
val seq2: int seq
val seq1_plus_seq2: ZipList<int>
Multiple items
union case ZipList.ZipList: 's seq -> ZipList<'s>

--------------------
module ZipList from FSharpPlus.Data
<summary> Basic operations on ZipList </summary>

--------------------
type ZipList<'s> = | ZipList of 's seq member Item: n: int -> 's static member (+) : x: ZipList<'a> * y: ZipList<'a> -> ZipList<'a> (requires member ``+``) static member (<*>) : ZipList<('a -> 'b)> * ZipList<'a> -> ZipList<'b> static member (<|>) : ZipList<'a1> * ZipList<'a1> -> ZipList<'a1> static member Return: x: 'a -> ZipList<'a> static member ToSeq: ZipList<'a1> -> 'a1 seq static member Traverse: ZipList<'T> * f: ('T -> 'Functor<'U>) -> 'Functor<ZipList<'U>> (requires member Map and member ``<*>`` and member IsLeftZero and member Map and member Map and member Traverse and member Return and member Map) static member get_Empty: unit -> ZipList<'a1> static member Zero: unit -> ZipList<'a> (requires member Zero)
<summary> A sequence with an Applicative functor based on zipping. </summary>
namespace FSharpPlus.Math
module Applicative from FSharpPlus.Math
<summary>Math Operators ready to use over Applicative Functors.</summary>
val seq1_plus_seq2': ZipList<int>
val arrCombined: ZipList<int>
val asMonoid: ZipList<string>
val result: x: 'T -> 'Functor<'T> (requires member Return)
<summary> Lifts a value into a Functor. Same as return in Computation Expressions. </summary>
<category index="2">Applicative</category>
val plus: x: 'Monoid -> y: 'Monoid -> 'Monoid (requires member ``+``)
<summary> Combines two monoids in one. </summary>
<category index="4">Monoid</category>