Created
June 23, 2009 20:24
-
-
Save bavardage/134817 to your computer and use it in GitHub Desktop.
This file contains 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
type Zipper a = ([a], a, [a]) | |
fibs = ([1,1,2,3,5], 8, [13,21]) :: Zipper Int | |
left (xs, y, (z:zs)) = (y:xs, z, zs) | |
*Main> fibs | |
([1,1,2,3,5],8,[13,21]) | |
*Main> left fibs | |
([8,1,1,2,3,5],13,[21]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment