[Haskell-beginners] brief example of ZipList?

Thomas Davie tom.davie at gmail.com
Tue Aug 11 01:52:40 EDT 2009


z1 :: ZipList (Int -> Int)
z1 = ZipList [succ,succ]

z2 :: ZipList Int
z2 = ZipList [1,2]

z3 :: ZipList Int
z3 = z1 <*> z2

Bob

On 11 Aug 2009, at 02:08, Michael P Mossey wrote:

> Can someone give me a brief example using ZipList? I want to do  
> something like
>
> z1 :: [Int -> Int]
> z1 = [succ,succ]
>
> z2 :: [Int]
> z2 = [1,2]
>
> z3 = z1 <*> z2
>
> But don't know to get it to regard these as ZipLists and not regular  
> lists.
>
> This is purely for learning purposes. No application in mind.
>
> -Mike
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://www.haskell.org/mailman/listinfo/beginners



More information about the Beginners mailing list