here is the post I wrote
https://vpatryshev.wordpress.com/2017/01/11/three-popular-fp-myths-2
That's James and Saunders bashing (in a generalized monoidal sense).
That's James and Saunders bashing (in a generalized monoidal sense).
Entry tags:
now, again, Krohn-Rhodes theory
A finite monoid can be decomposed to a bunch of simple finite groups (afaik, there are 26 kinds of them) and a parallel array of flip-flops.
Since an FSM is basically a monoid, an FSM can be decomposed the same way.
And I wonder, regexes, they can be decomposed/classified the same way.
Anybody here familiar with all this? I just found it.
Since an FSM is basically a monoid, an FSM can be decomposed the same way.
And I wonder, regexes, they can be decomposed/classified the same way.
Anybody here familiar with all this? I just found it.
now I'm totally confused
People started assuring me that Haskell streams may be empty. Meaning, not a comonad at all.
So, wtf, are they even monads? They also say a list can be infinite; well, any proof that it's still a monad? Not what you get if you build a free monoid (that's what a list is).
Or? Do they mean we actually need σ-algebras?!
So, wtf, are they even monads? They also say a list can be infinite; well, any proof that it's still a monad? Not what you get if you build a free monoid (that's what a list is).
Or? Do they mean we actually need σ-algebras?!
Entry tags:
вот так вот пишу нынче
def retrieveAllPatients(listOfProps: Seq[Props]): Result[Traversable[PatientInfo]] = { val listOfMaybePatients = listOfProps.zipWithIndex map (retrievePatientInfo _).tupled val maybeListOfPatients = Result.traverse(listOfMaybePatients) suspiciousError(s"Now we have all the patients, right?\n$maybeListOfPatients") maybeListOfPatients }
Шутки шутками, а Патерсон и МакБрайд как бы тут непосредственно вписываются.
Научите меня HoTT, и я у меня в коде будут торсоры и группы когомологий.
Смешно, конечно.
Entry tags:
Mike Stay today
Explained wtf a closed monoidal category is, then introduced π-calculus, then showed how to interpret π-calculus in monoidal categories, then, using Feynman diagrams, showed isomorphic transformations of concurrent code. Feynman diagrams applied to π-calculus. Not a dog's penis eh.
моноид из полугруппы
В разных там WriterMonad требуется, чтобы внутре был моноид, и возникает иной раз такое ощущение, что и везде нужен моноид. Ан нет, бывает и полугруппы достаточно.
Скажем,
Так получается, что тот нуль, что был в T раньше, теперь не будет нулём.
Та же фигня и с мапредьюсом - в качестве типа накапливаемых значений берётся полугруппа, а нуль присоединяется внешний.
Это, заодно, ответ на мой старый вопрос - шо за моноид в мапредьюсе. Да вот этот, с присоединённым нулём.
Скажем,
Option[T]
, где Т - полугруппа, можно считать моноидом - к полугруппе присоединяется внешний нуль.def sum(maybeX; Option[T])(maybeY: Option[T]) = maybeX match { case Some(x) => maybeY match { case Some(y) => Some(x+y) case None => Some(x) } case None => maybeY }
Так получается, что тот нуль, что был в T раньше, теперь не будет нулём.
Та же фигня и с мапредьюсом - в качестве типа накапливаемых значений берётся полугруппа, а нуль присоединяется внешний.
Это, заодно, ответ на мой старый вопрос - шо за моноид в мапредьюсе. Да вот этот, с присоединённым нулём.