首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏一个会写诗的程序员的博客

    Functors, Applicatives, And Monads In PicturesFunctors, Applicatives, And Monads In Pictures

    This is the idea that Functors, Applicatives, Monads, Arrows etc are all based on. How to learn about Monads: Get a PhD in computer science. Monads add a new twist. Functors apply a function to a wrapped value: ? Check out LYAH's section on Monads. For more monads and pictures, check out three useful monads.

    80440发布于 2018-12-12
  • 来自专栏函数式编程语言及工具

    深圳scala-meetup-20180902(3)- Using heterogeneous Monads in for-comprehension with Monad Transformer

      scala中的Option类型是个很好用的数据结构,用None来替代java的null可以大大降低代码的复杂性,它还是一个更容易解释的状态表达形式,比如在读取数据时我们用Some(Row)来代表读取的数据行Row,用None来代表没有读到任何数据,免去了null判断。由此我们可以对数据库操作的结果有一种很直观的理解。同样,我们又可以用Either的Right(Row)来代表成功运算获取了结果Row,用Left(Err)代表运算产生了异常Err。对于数据库编程我还是选择了Task[Either[E,Option[A]]]这种类型作为数据库操作运算的统一类型。可以看到这是一个复合类型:首先Task是一个non-blocking的运算结果类型,Either[E,Option[A]]则同时可以处理发生异常、获取运算结果、无法获取结果几种状态。我觉着这样已经足够代表数据库操作状态了。

    60720发布于 2018-10-11
  • 来自专栏dylanliu

    Java示例演示Functor 和monad

    However introduction to monads, albeit very much related to reactive programming, didn't suit very well There are numerous other examples of monads you already came across without knowing that. But it is high time to look at monads. We have two independent monads, one of type Month and the other of type Integer. I hope you now understand why monads are so popular these days.

    85520发布于 2019-07-01
  • 来自专栏云云众生s

    JavaScript的5项前沿技术

    Monads(异步操作) Monads 有助于 组合需要上下文的函数 以返回一个值,并且在简化错误管理和减少意外结果的可能性方面非常有效。 Monads 旨在尽可能简化代码中函数的组合。 单子可以分解为三种函数组合: 函数映射:a => b 具有上下文的函子映射:Functor(a)=> Functor(b) Monads 展平(从上下文中解包值)并使用上下文映射:Monad(Monada

    28600编辑于 2024-05-24
  • 来自专栏CreateAMind

    范畴论与机器学习

    probability A Convenient Category for Higher-Order Probability Theory Bimonoidal Structure of Probability Monads Dependent Type System based on Non-Deterministic Beta Reduction Probability, valuations, hyperspace: Three monads Neural Networks as Parametric CoKleisli morphisms Optics vs Lenses, Operationally Meta-learning and Monads

    46310编辑于 2023-11-30
  • 来自专栏编舟记

    Monad

    > Tuple //compose // flatmap 即 bind,中缀表达式一般是 >>= Tuple >>= (Number -> Tuple) >>= (Number -> Tuple) Monads 参考链接: Translation from Haskell to JavaScript of selected portions of the best introduction to monads I've ever read 我所理解的monad Monads for functional programming Functor, Applicative, Monad

    1.9K50发布于 2018-08-17
  • 来自专栏爬虫技术学习

    15 分钟了解 Monad

    泛化 - Monads 如果我们想要组合函数 f1, f2, ... fn. 如果所有的参数都和返回类型对的上, 那么我们可以直接 调用 fn(...f2(f1(x))...). 本文只是简单地介绍 了 Monad 的一些只管解释, 还可以查看下面这些资料: Monad on Wikipedia Monads in Python List of Monad tutorials 本文主要翻译自 : https://nikgrozev.com/2013/12/10/monads-in-15-minutes/

    65910编辑于 2023-02-10
  • 来自专栏C++ 动态新闻推送

    C++ 中文周刊 第128期

    以下两篇文章来自CppMore,大家也可以关注cppMore公众号 Compile time dispatching in C++20[6] 用fixed_stding做类型tag,tag有必要这么花哨吗 Monads time dispatching in C++20: https://www.cppmore.com/2023/08/16/compile-time-dispatching-in-cpp20/ [7] Monads in Modern C++, What, Why, and How: https://www.cppmore.com/2023/08/14/monads-in-modern-c-what-why-and-how

    20010编辑于 2024-07-30
  • 来自专栏橙光笔记

    《JavaScript函数式编程指南》读书笔记

    _value})`; } } //简单使用 var msg = Wrapper.of('Hello Monads!') .map(R.toUpper) .map(R.identity); //-> Wrapper('HELLO MONADS!') // 无论多少层只要调用.join就会返回最后一层 msg.join();//-> Wrapper('HELLO MONADS!') msg.join().get();//-> 'HELLO MONADS!' Maybe Monad用来处理是否为空的判断逻辑。它有2个具体的类型:Just和Nothing。

    1.3K43发布于 2020-10-19
  • 来自专栏Rust语言学习交流

    【Rust日报】 2019-07-08:hunter - 终端下的文件浏览器

    Higher-KindedType 该文作者提出了一种方法,通过类型参数向下转换泛型trait来模拟当前Rust中的高阶类型/泛型关联类型,并且提供了使用该方法在Rust中创建Functors,Applicatives和Monads

    1.1K20发布于 2019-07-15
  • 来自专栏京程一灯

    解决 JavaScript 中处理 null 和 undefined 的麻烦事[每日前端夜话0xE6]

    JavaScript 有称为 Promise 的内置异步Either monad-ish 数据类型【https://medium.com/javascript-scene/javascript-monads-made-simple 如果你对 functors【https://medium.com/javascript-scene/functors-categories-61e031bac53f】 和 monads【https:/ /medium.com/javascript-scene/javascript-monads-made-simple-7856be57bfe8】 比较熟悉,那么过程将变得更加容易;如果这听起来令人生畏,

    1.8K20发布于 2019-11-14
  • 来自专栏函数式编程语言及工具

    深圳scala-meetup-20180902(1)- Monadic 编程风格

    我这次的分享主要分三个主题:“Monadic编程风格“、”Future vs Task and ReaderMonad应用方法“及”using heterogeneous monads in for-comprehension 我们再看看Monadic编程: monadic programming : program with monads val fp3 = F[p1] ⊕ F[p1] ⊕ F[p1] = F[p1+p2+p3

    75830发布于 2018-09-28
  • 来自专栏一个会写诗的程序员的博客

    什么是 Monad (Functional Programming)?函子到底是什么?ApplicativeMonad

    > Tuple //compose // flatmap 即 bind,中缀表达式一般是 >>= Tuple >>= (Number -> Tuple) >>= (Number -> Tuple) Monads 参考链接: Translation from Haskell to JavaScript of selected portions of the best introduction to monads I've ever read 我所理解的monad Monads for functional programming Functor, Applicative, Monad ---- 函子functor

    5.2K30发布于 2018-12-12
  • 来自专栏掘金安东尼

    你就是函数响应式编程(FRP)啊?!【附 RxJS 实战】

    函数响应式编程(FRP)所做的就是:遍历整个事情流集合,将导致 b 和 c 变化的事情回放,并获得 a 的结果; 【事件流】被称为【被观察者序列】(observable sequences),其实被观察者是一种 Monads 说明:既然是一种 Monads,就意味着存在延迟计算,即只有当变量真正使用时才去计算,整个链式遍历的过程也是这样。更多 RxJS 在 JS 中,能体现 FRP 的第三方框架是 RxJS。

    1.3K10编辑于 2022-09-19
  • 来自专栏Java技术栈

    如何更优雅的使用 Java 8 函数式编程?

    numberProvider.getNumber(), numberProvider.getNumber()); } 原文:https://dzone.com/articles/lifting-functions-to-work-with-monads-in-java

    1.5K20发布于 2020-05-26
  • 来自专栏数据科学与人工智能

    【Python环境】如何使用正确的姿势进行高效Python函数式编程?

    函数式编程的特点 函数式编程有如下特点: 函数即为数据,第一等公民 高阶函数 纯函数: 避免状态,无副作用 不可变数据结构 强编译器 尾递归消除(TRE) 延迟,模式匹配(Pattern Match),Monads 这个议题除了Monads,其他都有所覆盖。

    2K100发布于 2018-02-26
  • 来自专栏爱写Bug

    Python Weekly 427

    shrynk-using-machine-learning-to-learn-how-to-compress Monad 没有你想的那么难 链接: https://bytes.yingw787.com/posts/2019/12/06/monads

    80620发布于 2019-12-18
  • 来自专栏Bennyhuo

    Kotlin版图解Functor、Applicative与Monad

    本文是从 Haskell 版 Functors, Applicatives, And Monads In Pictures 翻译而来的 Kotlin 版。 在此向 Functors, Applicatives, And Monads In Pictures 原作者 Aditya Bhargava 致谢, 向 Learn You a Haskell 作者 Miran

    1.9K20发布于 2020-02-20
  • 来自专栏一名前端开发

    JavaScript 开发规范---让你的代码像诗一样优雅(二)

    反例: /** * 2016-12-20: Removed monads, didn't understand them (RM) * 2016-10-01: Improved using special monads (JP) * 2016-02-03: Removed type-checking (LI) * 2015-03-14: Added combine with type-checking

    58820编辑于 2023-11-01
  • 来自专栏CreateAMind

    用数学定义:层次、对称、模型、动作、相似、上下文

    local-to-global principles are sheaves, self-similarity is modeled by operads, context can be modeled by monads

    40830编辑于 2022-03-14
领券