摘要: Haskell Zipper 二叉树 记录方向 二元树 data Tree a = Empty | Node a (Tree a) (Tree a) 改变节点值 data Direction = L | R change :: [Direction] -> Tree Char -> Tree Cha 阅读全文
posted @ 2025-05-08 23:53 (.)$(.) 阅读(7) 评论(0) 推荐(0)
摘要: 函子 应用函子 单子 定义 Functor class Functor f where fmap :: (a -> b) -> f a -> f b fmap id == id -- 恒等律 fmap (f . g) == fmap f . fmap g -- 组合律 Applicative cla 阅读全文
posted @ 2025-05-08 16:25 (.)$(.) 阅读(10) 评论(0) 推荐(0)