結論から言うとOCamlのバージョンを上げてやることで解決しました。
問題
本来utopで'a Deferred.t型の値を評価すると計算結果('a)を表示してくれるのですが、手元のutop 2.0.1 + OCaml 4.02.3では次のように表示されました。
utop # let three = Async.Std.return 3;;
val three : int Deferred.t = <abstr>
utop # three;;
- : int Deferred.t = <abstr>
対処法
opam switchでOCamlのバージョンを変更(4.02.3 -> 4.03.0)します。
$ opam switch 4.03.0
基本的にはこれで終わりですが、モジュール等はインストールしなおす必要があります。
$ eval `opam config env`
$ opam install utop core async
確認
utop # let three = Async.Std.return 3;;
Characters 12-28:
Warning 3: deprecated: module Async.Std
[since 2017-02] use Async. The Std sub-module is no longer needed
val three : int Async.Deferred.t = <abstr>
utop # three;;
- : int = 3
ちゃんとDeferredの中身が分かるようになりました。
ちなみにutopのバージョンが原因という場合もあるようです。
Utop not waiting for Deferred to determine then displaying result · Issue #137 · diml/utop
Async.Std.Deferred.t not automatically resolving · Issue #219 · diml/utop