Sign in

    moonchor

    Choreographic programming library for MoonBit.

    Choreographic
    MoonBit
    Download zip
    Author
    Version
    0.4.0
    License
    Apache-2.0
    Last updated
    last year
    Downloads
    145

    #Moonchor: Choreographic Programming Library for MoonBit

    #Todo

    Location

    pub(open) trait Location : Show + Hash {
    name(Self) -> String
    }

    Logger

    pub trait Logger {
    info(Self, String) -> Unit
    }

    Backend

    type Backend

    Backend::check_location

    fn Backend::check_location(self : Backend, loc : Location) -> Bool

    Backend::get_logger

    fn Backend::get_logger(self : Backend) -> Logger

    ChoreoContext

    type ChoreoContext

    ChoreoContext::comm

    fn ChoreoContext::comm[T :
    FromJson
    + ToJson, From : Location + Show + Hash, To : Location + Show + Hash](self : ChoreoContext, from : From, to : To, value : Located[T, From]) -> Located[T, To]

    ChoreoContext::condition

    fn ChoreoContext::condition[L : Location + Show + Hash](self : ChoreoContext, loc : L, c : Located[Bool, L]) -> Bool

    ChoreoContext::get_location

    fn ChoreoContext::get_location[L : Location + Show + Hash](self : ChoreoContext, loc : L) -> L

    ChoreoContext::locally

    fn ChoreoContext::locally[T, L : Location + Show + Hash](self : ChoreoContext, location : L, computation : (Unwrapper[L]) -> T) -> Located[T, L]

    ConsoleLogger

    type ConsoleLogger

    Located

    type Located[T, _]

    MuteLogger

    type MuteLogger

    Unwrapper

    type Unwrapper[_]

    Unwrapper::unwrap

    fn Unwrapper::unwrap[T, L](_ : Unwrapper[L], v : Located[T, L]) -> T

    async_each

    fn async_each[T](iter : Iter[T], f : (T) -> Unit) -> Unit

    async_each2

    fn async_each2[A, B](iter : Iter2[A, B], f : (A, B) -> Unit) -> Unit

    check_location

    fn check_location(self : Backend, loc : Location) -> Bool

    comm

    fn comm[T :
    FromJson
    + ToJson, From : Location + Show + Hash, To : Location + Show + Hash](self : ChoreoContext, from : From, to : To, value : Located[T, From]) -> Located[T, To]

    condition

    fn condition[L : Location + Show + Hash](self : ChoreoContext, loc : L, c : Located[Bool, L]) -> Bool

    get_location

    fn get_location[L : Location + Show + Hash](self : ChoreoContext, loc : L) -> L

    get_logger

    fn get_logger(self : Backend) -> Logger

    locally

    fn locally[T, L : Location + Show + Hash](self : ChoreoContext, location : L, computation : (Unwrapper[L]) -> T) -> Located[T, L]

    make_console_logger

    fn make_console_logger() -> ConsoleLogger

    make_local_backend

    fn make_local_backend(locations : Array[Location], logger~ : Logger = ..) -> Backend

    make_mute_logger

    fn make_mute_logger() -> MuteLogger

    run_choreo

    fn run_choreo[T, L : Location + Show + Hash](backend : Backend, choreography : (ChoreoContext) -> T, role : L, logger? : Logger) -> T

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io