Created
October 26, 2009 21:27
-
-
Save abuiles/219056 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
newtype ZipList a = ZipList { getZipList :: [a] } | |
instance Functor ZipList where | |
fmap g (ZipList a) = ZipList $ fmap g a | |
instance Applicative ZipList where | |
pure a = ZipList [a] | |
(ZipList fs) <*> (ZipList xs) = ZipList $ zipWith ($) fs xs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment