Skip to content

Instantly share code, notes, and snippets.

@evancz
Created April 4, 2015 00:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save evancz/6867683502643712a007 to your computer and use it in GitHub Desktop.
Save evancz/6867683502643712a007 to your computer and use it in GitHub Desktop.

Task Modules

Should all tasks run through main or should they run through a main module? Here is a syntax proposal of the latter based on the async/await syntax

async module Main where

mb = await mailbox

main =
  Signal.map (view mb.address) (Stream.fold update model mb.stream)

The rule would be that you can only instantiate an async module from JS for now.

The first-class module systems related to ML are able to handle impure modules anywhere in the code base. We don't have a well developed framework for that, so we can constrain the effects to the root module and have an acceptable outcome. Eventually this could be expanded to support submodules, but only with a fancier module system. I don't think the fact that we don't have that system now means we cannot have a limited form of async module

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment