TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Learn you a Haskell: Zippers

49 点作者 voxcogitatio超过 14 年前

5 条评论

jberryman超过 14 年前
LYAH is great. For those who are interested, there is a library, 'syz' (Scrap Your Zippers), which provides a generic zipper for any data type, even mutually-recursive types:<p><a href="http://hackage.haskell.org/packages/archive/syz/0.2.0.0/doc/html/Data-Generics-Zipper.html" rel="nofollow">http://hackage.haskell.org/packages/archive/syz/0.2.0.0/doc/...</a><p>Its internals are pretty interesting if you've ever thought about implementing a generic zipper structure. For example it uses Typeable to reify the focus type.<p>I'm finishing up my own generic zipper library which I hope will be simpler and more useful than syz.
eru超过 14 年前
Here's a challenge: Design a zipper that works for cyclic graphs. There will be 10 GBP for the winner's charity of choice. (jacquesm may give another 10 Euro in addition.)<p>(Hint: "Purely Functional Datastructures" solves this problem for graphs shaped like a sigle ring. Perhaps this solution can be generalized?)
评论 #1867241 未加载
jwr超过 14 年前
Clojure also has a pretty neat zipper library in contrib. I've used it in projects and I wish I had introductory material as great as this tutorial back then.
jewbacca超过 14 年前
I've had an investigation on the backburner for a while on whether there's a zipper-like structure for representing 2D grids (eg, a game board). I feel like this may be a blind alley, because a grid would have cycles and no inherent ordering. Can anybody shed some light on this?
评论 #1866885 未加载
评论 #1867319 未加载
grogers超过 14 年前
Another good introduction to zippers that helped me understand them in plain terms is: <a href="http://blog.ezyang.com/2010/04/you-could-have-invented-zippers" rel="nofollow">http://blog.ezyang.com/2010/04/you-could-have-invented-zippe...</a>
评论 #1866437 未加载