here is the post I wrote
Jan. 10th, 2017 05:33 pm 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).
now, again, Krohn-Rhodes theory
Jan. 10th, 2017 02:41 pm 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
Aug. 18th, 2016 01:05 pmPeople 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?!
вот так вот пишу нынче
Oct. 8th, 2013 01:44 pmdef 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, и я у меня в коде будут торсоры и группы когомологий.
Смешно, конечно.
моноид из полугруппы
Jun. 10th, 2012 04:41 pmВ разных там 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 раньше, теперь не будет нулём.
Та же фигня и с мапредьюсом - в качестве типа накапливаемых значений берётся полугруппа, а нуль присоединяется внешний.
Это, заодно, ответ на мой старый вопрос - шо за моноид в мапредьюсе. Да вот этот, с присоединённым нулём.