How to Include Tasks in Bucklescript-TEA

Have you tried to use the Task library before and gotten

The module or file Task can't be found.

before?


Don’t you just use it like all other modules in Bucklescript-TEA like:

(* Either open it *)
open Task

(* or just qualify it with name of the module *)
Task.succeed

Nope, that doesn’t work at first.


This is a way to get it to work (add this):

module Task = Tea_task

then this will work again:

Task.succeed


The reason why this is, is because in the main tea.ml file:

module Result = Tea_result

module Cmd = Tea_cmd

module Sub = Tea_sub

module App = Tea_app

module Debug = Tea_debug

module Html = Tea_html

module Html2 = Tea_html2

module Svg = Tea_svg

(* module Task = Tea_task *)

module Program = Tea_program


module Time = Tea_time


module Json = Tea_json


module Navigation = Tea_navigation


module Random = Tea_random


module AnimationFrame = Tea_animationframe

module Mouse = Tea_mouse

module Http = Tea_http


module Ex = Tea_ex

You can see that Task is commented out. Not sure why this is.

(Similarly you would do the same if some other module was missing and didn’t work, you could give this a trick a try)

Comments