Setting custom prompt in utop with UTop.prompt

"John Magolske [email protected] [ocaml_beginners]" <[email protected]>
Newsgroups gmane.comp.lang.ocaml.beginners
Message-ID <[email protected]>
Hi,

I'd like to adjust the utop prompt, and am trying to sort out what to
input to utop & place in my ~/.ocamlinit file. It says here:

    https://opam.ocaml.org/blog/about-utop/

    The prompt can be customized by the user, by setting the reference
    UTop.prompt:

        utop # UTop.prompt;;
        - : LTerm_text.t React.signal ref = {contents = <abstr>}

But I'm not sure what to do beyond entering UTop.prompt;; into utop...
following some suggestions here:

    http://irclog.whitequark.org/ocaml/2015-03-19.txt

I tried:

    #require "react";;
    UTop.prompt := React.S.const (LTerm_text.of_string "");;

but got:

    Error: Unbound module LTerm_text

also took a look at this:

    https://twitter.com/keleshev/status/573401484177612800
    UTop.prompt := fst (React.S.create LTerm_text.(eval [B_fg (LTerm_style.green); S "# "])

Which has unbalanced parentheses...not sure what it should be.
Not sure what to make of this either:

    http://stackoverflow.com/questions/6158596/setting-the-prompt-in-an-ocaml-custom-toplevel

I'm just getting started learning OCaml basics, so feeling a bit lost
here...any clarification would be much appreciated.

John

-- 
John Magolske
http://B79.net/contact
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.