fp myths part 3
Jan. 19th, 2017 07:37 pm 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.
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.
so, free monads
Nov. 1st, 2016 07:13 pmAs 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.
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.
talking about free monads
Oct. 29th, 2016 11:33 pmNo, 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.
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.
FreeMonad, 23 lines of Scala code
Aug. 21st, 2016 04:36 pmhttps://gist.github.com/jdegoes/63786ba167ec3da151c0d079a5516ae1
Pretty neat, eh? And almost self-explaining.
Pretty neat, eh? And almost self-explaining.
Ok, I rest my case
Oct. 3rd, 2015 09:00 pmFree 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.
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.
Tony Morris said
Apr. 18th, 2011 05:00 pm"Every
single function that exists on
Indeed,
The following trait is exactly equivalent to scala.List in its structure:
As an exercise, implement the entire
method."
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 abstractmethod."