Git Product home page Git Product logo

non-sequencing-monads's Introduction

Monads Are Not About Sequencing

This repo contains code for examples presented in my talk Monads Are Not About Sequencing (Functional Scala 2023, video, slides).

Examples:

  • Monads in the category <:< (Scala's subtype relationship)
    • are closure operators on the partial order of Scala types
    • example given: type Result[+A] = Error | A
    • no sequencing because there's no execution or effects
  • Monads in the category <= (opposite category to =>)
    • are comonads from =>
    • example given: Id
    • executes in reverse order, i.e. not the sequence given in code
  • Writer monad (in =>) type Writer[A] = (List[String], A) with flipped concatenation (as, bs) => bs ++ as
    • constituent logs appear in reverse order, i.e. not the sequence given in code
  • Concurrent, nondeterministic Writer monad in -โšฌ, the category of Libretto functions
    • with concurrent merge as the monoid operation to combine logs
    • non-deterministic order of messages in the result log

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.