juan_gandhi: (Default)
[personal profile] juan_gandhi
I just figured out yesterday that yes, Tree[T] is a monad over T. Obvious, but. Same with BinaryTree[T]. Also, BinaryTree[T] does not seem to me applicative.

(My previous attempt to slap together a monad-looking functor were wrong.)  

Date: 2019-11-02 07:55 am (UTC)
From: [personal profile] sassa_nf
Interesting. How can a monad not be applicative?

Date: 2019-11-02 04:49 pm (UTC)
epimorphisms_split: (Default)
From: [personal profile] epimorphisms_split
Ну чушь же по первой ссылке написана. Законы монады не выполняются.

Должно быть m >>= return = m, а этого нет. >>= берет только корень левого аргумента, а листья все состригает. Fail.

(Я о первом дереве, у которого данные в узлах; если данные в листьях, то это вроде таки монада)
Edited Date: 2019-11-02 04:59 pm (UTC)

Date: 2019-11-02 05:35 pm (UTC)
From: [personal profile] sassa_nf
Oh, mathematically - I can't comment. I thought you meant in programming. Someone showed that a monad in a category we call CCC, is always an applicative functor. (Because we have function application and tuples)

Date: 2019-11-02 10:17 am (UTC)
norian: (Default)
From: [personal profile] norian
ну то есть построить дерево сортировки по множеству - функтор, а какое-нть дерево вообще - монада ?

Edited Date: 2019-11-02 10:18 am (UTC)

Profile

juan_gandhi: (Default)
Juan-Carlos Gandhi

June 2025

S M T W T F S
1 2345 6 7
8 9 10 11 121314
15161718 1920 21
22232425262728
2930     

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 26th, 2025 11:57 pm
Powered by Dreamwidth Studios