Beth Anderson · @betandr
312 followers · 151 posts · Server hachyderm.io

Really great talk from Daniela Petruzalek using generics to implement a !

#monad #gopherconuk23 #golang

Last updated 1 year ago

Andrew Helwer · @ahelwer
54 followers · 636 posts · Server fosstodon.org

there is a nonzero chance I will actually learn what a is this week

#monad

Last updated 1 year ago

· @gugod
324 followers · 2349 posts · Server g0v.social
Jencel Panic · @abuseofnotation
315 followers · 490 posts · Server mathstodon.xyz

For example, memorizing the type signature that defines what a is, even if you understand it perfectly would not teach you what a monad is (although it is a good first step).

return :: a -> m a
(>>=) :: m a -> (a -> m b) -> m b

Learning what a monad is, means feeling a given feeling. And, this is why, there is no straightforward way to explain what a monad is. This is why everyone approaches it (explaining monads) differently and still no explanation is completely correct.

This is why for a layperson, reading a math textbook is often unnerving and unpleasant, in the same way as a child who never experienced romantic love, would find reading love stories (or any other book for grown-ups) unpleasant.

But once it "clicks" it suddenly makes sense - everyone knows that, but many don't realize that this clicking has nothing to do with memorization, it is just the experience of a feeling.

#monad

Last updated 2 years ago

yhm · @yhm
12 followers · 265 posts · Server social.dev-wiki.de
Kenneth Freeman · @Kencf618033
257 followers · 5514 posts · Server social.linux.pizza

Reinstalled on and got SiDock running on it on ... Ligands and protein folding or whatever vs. , a worthy project. °°°Shall name Mother’s hand-me-down computer “COBOL”, it’s such a relic... I haven’t one common theme, of course. °°°

#linuxmint #monad #boinc #COVID19

Last updated 2 years ago

redmp (EDITED) · @redmp
82 followers · 344 posts · Server recurse.social

I tried to model asynchronous exception masking-state and the safety of interruptible-actions explicitly on the . How did I do?

gist.github.com/plredmond/b834

#monad #io #haskell

Last updated 2 years ago

Niles Johnson · @nilesjohnson
702 followers · 815 posts · Server mathstodon.xyz

I have a reference request related to and theory. Suppose I have two different monads, S and T, on a category C. I know there are associated categories of S-algebras and T-algebras. Is there a reference that talks about objects that are algebras for *both* S and T? More specifically, my student is interested in constructing a monad, F, whose algebras are the "intersection" of S- and T-algebras.

An example would involve sets with two different algebraic operations, one governed by S and the other by T. We would like to know about sets that have *both* operations, with no condition on compatibility between them. If someone knows a simple and more specific example, I'd be happy to hear about that too.

My student has a neat construction of F for an application we have in mind, and it involves something like a colimit of (ST)^n. (But not exactly that, and I don't really want to say more about that if I don't have to.) I think someone must have thought about this kind of thing before in slightly more generality. Please let us know if you've heard of this kind of thing :)

#category #monad

Last updated 2 years ago

Yoriyuki Yamagata · @yoriyuki
3 followers · 2 posts · Server mathstodon.xyz

I tried to write a Python program using Monad. Not sure a good way to do, though

I'm coding a statistical simulator, in which I need both of realized values and probability.

#monad #programming #statistics #python

Last updated 2 years ago

· @dcz
263 followers · 1602 posts · Server fosstodon.org

Ever wanted to use to manipulate images like iterators?

image
.map(to_rgb)
.filter(|r, g, b| b > 100)
.collect();

Well, I don't quite have that, but I do have a -ish library called .

framagit.org/dcz/obraztam

It's -first, it has .map() and .zip() and it optimizes to instructions. Can be easily parallelized even more.

I used it to detect beams in the picture!

#rust #monadic #obraztam #immutable #simd #laser #graphics #monad #iterator

Last updated 2 years ago

Jim Donegan ✅ · @jimdonegan
1418 followers · 3947 posts · Server mastodon.scot
nope · @stacked_automation
129 followers · 7144 posts · Server mastodon.social
Peter Ludemann · @PeterLudemann
15 followers · 119 posts · Server mathstodon.xyz

@dabeaz I think that `(set! var value)` is essentially the same as `var=value` ... for a Python abstract interpreter (type analyzer) in , I used something similar to -passing, but with 4 items in the continuations (some are lists, some are red-black trees; all are immutable) - these can be a bit of pain to manipulate but I used a -like notation to simplify things. I presume that something similar could be done in .

#haskell #monad #continuation #prolog #python #scheme

Last updated 2 years ago

Martin McWhorter · @martin
117 followers · 475 posts · Server mastodon.ie

@wilfredh in the Result type is called a . Implementing a monad in is simple enough, though there are plenty of FP libraries out there that provide these types out of the box.

There are many to choose from, this is one example gcanti.github.io/fp-ts/modules

#functionalprogramming #monad #typescript

Last updated 2 years ago

OT Chen :ablobgrin: · @ot32em
70 followers · 1109 posts · Server g0v.social

Free Monad?

1.
要支援 fmap
要支援 fmap|pure|<*>
要支援 fmap|pure|<*>|>>=

可以看到越強的 typeclass,約束越大。

有沒有一個載體 M,可以讓你只有支援 fmap 的 Functor f。擺進去之後,M f 也可以有 Monad 的能力?

讓你的 Functor f,免費地(free) 獲得 Monad 的能力?

這個神祕的載體 M,就是 Free Monad。

2. 文章有提到一個 FreeMonad 的實作。是將 FreeMonad 以 List 遞迴的結構來建構。

`M f` 的 fmap|pure|>>=,可以只靠 (1) `M f` 本身的結構 加上 (2) f 的 fmap 來組裝起來。

3. 用到 M 的結構,來取代 f 要成爲 Monad 所需要的約束。
那麼你對 M f 的操作,都要繞一下 M 的結構,才能達到。 像是 Code 的 type 複雜度越來越複雜,後面的例子都看不懂了XD

#FP筆記 #Functor #Applicative #monad

Last updated 2 years ago

OT Chen :ablobgrin: · @ot32em
70 followers · 1106 posts · Server g0v.social

Free Monad?

1.
要支援 fmap
要支援 fmap|pure|<*>
要支援 fmap|pure|<*>|>>=

可以看到越強的 typeclass,約束越大。

有沒有一個載體 M,可以讓你只有支援 fmap 的 Functor f。擺進去之後,M f 也可以有 Monad 的能力?

讓你的 Functor f,免費地(free) 獲得 Monad 的能力?

這個神祕的載體 M,就是 Free Monad。

2. 文章有提到一個 FreeMonad 的實作。是將 FreeMonad 以 List 遞迴的結構來建構。

`M f` 的 fmap|pure|>>=,可以只靠 (1) `M f` 本身的結構 加上 (2) f 的 fmap 來組裝起來。

3. 用到 M 的結構,來取代 f 要成爲 Monad 所需要的約束。
那麼你對 M f 的操作,都要繞一下 M 的結構,才能達到。 像是 Code 的 type 複雜度越來越複雜,後面的例子都看不懂了XD

#FP筆記 #Functor #Applicative #monad

Last updated 2 years ago

OT Chen :ablobgrin: · @ot32em
70 followers · 1106 posts · Server g0v.social

Free Monad?

1. 要支援 fmap;
要支援 fmap|pure|<*>;
要支援 fmap|pure|<*>|>>=。

可以看到越強的 typeclass,約束越大。

有沒有一個載體 M,可以讓你只有支援 fmap 的 Functor f。擺進去之後,M f 也可以有 Monad 的能力?

讓你的 Functor f,免費地(free) 獲得 Monad 的能力?

這個神祕的載體 M,就是 Free Monad。

2. 文章有提到一個 FreeMonad 的實作。是將 FreeMonad 以 List 遞迴的結構來建構。

`M f` 的 fmap|pure|>>=,可以只靠 (1) `M f` 本身的結構 加上 (2) f 的 fmap 來組裝起來。

3. 用到 M 的結構,來取代 f 要成爲 Monad 所需要的約束。
那麼你對 M f 的操作,都要繞一下 M 的結構,才能達到。 像是 Code 的 type 複雜度越來越複雜,後面的例子都看不懂了XD

#FP筆記 #Functor #Applicative #monad

Last updated 2 years ago

I've been a professional for decades, and I still have no idea what a is.

Every time I try to read up, I seem to get descriptions that are highly abstract and confusing. It reminds me a bit of first learning what a "tensor" is... most people have very simple examples of tensors, but can't explain why it is a "thing" relative to other things.

Clearly "monad" solves a problem of some kind, but I haven't the foggiest idea what it is.

Please enlighten me. 😁

#softwareengineer #monad

Last updated 2 years ago

mnml mnl (he/him) · @mnl
350 followers · 2132 posts · Server hachyderm.io

tuesday is not monday, it's day!

#monad

Last updated 2 years ago

Jan :rust: :ferris: · @janriemer
396 followers · 546 posts · Server floss.social

There you go:

A is something you can flatMap().

¯\_(ツ)_/¯

#functionalprogramming #fp #monad

Last updated 2 years ago