V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
• 请不要在回答技术问题时复制粘贴 AI 生成的内容
netcan
V2EX  ›  程序员

详解函数式编程之 Monad

  •  
  •   netcan ·
    netcan · Oct 2, 2020 · 3734 views
    This topic created in 2044 days ago, the information mentioned may be changed or developed.

    最近终于搞清楚了 Monad 的本质,趁热记录下来,相信大家或多或少在编程语言中见过并用过,只不过不知道那是 Monad 罢了,也为了方便大家理解 Monad,后面我会用各种主流语言中具有代表性的 Monad 作为例子,如果对理论不感兴趣可以直接跳到后面,寻找你熟悉语言的例子进行理解后,再回头看看理论。感兴趣的可以看看我写的文章: https://zhuanlan.zhihu.com/p/260966706

    8 replies    2024-01-15 10:15:52 +08:00
    aijam
        1
    aijam  
       Oct 2, 2020   ❤️ 4
    Every Haskell programmer will write a blog about Monad at some point
    leavebody
        2
    leavebody  
       Oct 2, 2020
    @aijam 哈哈哈哈哈
    thedrwu
        3
    thedrwu  
       Oct 2, 2020 via Android
    然后你会发现因为 monad transformer 运行效率特别低,最终舍弃这些抽象只拿来做 IO 。
    netcan
        4
    netcan  
    OP
       Oct 3, 2020
    @thedrwu 做异步抽象啊,比如 js 的 promise,c++也可以借鉴思想。
    netcan
        5
    netcan  
    OP
       Oct 3, 2020 via Android
    @aijam I'm a c++ progammer, not haskell
    Balthild
        6
    Balthild  
       Oct 10, 2020
    讲个玩笑:

    Monad 是这样一种奇怪的东西:每个人都能理解它,但每个人对它的表述都是错的。
    netcan
        7
    netcan  
    OP
       Oct 24, 2020
    @Balthild 看你怎么理解表述了
    GuangXiN
        8
    GuangXiN  
       Jan 15, 2024
    @Balthild #6 听起来像在说上帝
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4030 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 40ms · UTC 10:21 · PVG 18:21 · LAX 03:21 · JFK 06:21
    ♥ Do have faith in what you're doing.