juan_gandhi: (Default)
In the category of linear spaces each object has exactly one point. Now try to build a "free monad". Or? 
juan_gandhi: (Default)
 https://vpatryshev.wordpress.com/2017/01/20/three-popular-fp-myths-3/

More Haskell bashing.

"Haskell is so good that if a functor does not have a free monad, it cannot be written in Haskell". Which is funny. Something like Haskell version of Church thesis.
juan_gandhi: (VP)
As I understand for a functor F to be able to produce a free monad, it has to preserve colimits, right? That includes unions.

So the functor X2, not preserving sums, cannot produce a free monad... right? I think so, at least.

On the other hand, a fixpoint of 1+X2 is a binary tree. So? :)

Something's wrong here.
juan_gandhi: (VP)
No, seriously, can anybody kind of explain to me when they exist?

Have a category C, and endofunctor F, M(F) = fixpoint of (Id + F∘M), right?

Ok, let C be complete, cocomplete, so what? Where's the free monad? Meaning, how come it's a monad at all?

Am I missing something? I don't want a "for example", it's not a proof.
juan_gandhi: (VP)
Free monad FT for a functor T is defined as FT[X] = X + FT[T[FT[X]]], евпочя.

Or is it FT[X] = X + T[FT[X]]?

Now how exactly do we provide a monad multiplication, I'm totally lost. Can't figure out. Ideas?

An update, of 2020. The latter. And we count on an assumption that T preserves filtered colimits.
juan_gandhi: (VP)
Say, we have a regex, right? This is a regular language; so there must be a free monad with a pretty simple structure. May be related to State monad, I guess.
juan_gandhi: (Default)
"Every
single function that exists on List can be written using foldRight.
Indeed, List *is* foldRight.

The following trait is exactly equivalent to scala.List in its structure:
trait List[A] {
 def foldRight[B](b: B, f: (A, B) => B): B
}

As an exercise, implement the entire List API using this single abstract
method."

Profile

juan_gandhi: (Default)
Juan-Carlos Gandhi

May 2025

S M T W T F S
    1 2 3
456 7 8 9 10
11 121314151617
18192021222324
25262728293031

Syndicate

RSS Atom

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated May. 15th, 2025 03:13 pm
Powered by Dreamwidth Studios