しばらく検索しましたが、解決策が見つかりません。おそらく、私が理解できない単純な構文の問題です。
私はタイプを持っています:
# type ('a, 'b) mytype = 'a * 'b;;
そして、 type の変数を作成したいと思いますstring string sum
。
# let (x:string string mytype) = ("v", "m");;
Error: The type constructor mytype expects 2 argument(s),
but is here applied to 1 argument(s)
型パラメーターを括弧で囲む別の方法を試しましたが、ほとんど同じエラーが発生します。
ただし、単一のパラメーター型で機能するため、わからない構文があると思います。
# type 'a mytype2 = string * 'a;;
# let (x:string mytype2) = ("hola", "hello");;
val x : string mytype2 = ("hola", "hello")
誰か、2つのパラメータでこれを行う方法を教えてもらえますか?