Snippets tagged monoid

  • Composing a list of functions

    Composition of functions in F# is easily achieved by using the >> operator. You can also chain an arbitary amount of functions (represented as a list or sequence) together by folding the list/seq with >>. [More formally: the set of endomorphisms 'a -> 'a forms a monoid with the binary, associative operator ">>" (or "<<") and the neutral element "id".]

    78 people like this

    Posted: 7 years ago by Novox

  • Update Monad in F# based on Tomas Petricek article

    This is 100% based on tomas petricek blog article. there has been some small additions in regards to adding Result type and handling Monoids for the Writer Part. go check the following blog article : Comment appreciated + bear in mind that performance wise, the Monoid Combine operator, could be greatly improved and more.

    3 people like this

    Posted: 2 months ago by Fahd Abdeljallal