如何撰写两个函数?

时间:2017-11-27 09:05:38

标签: scala

我有两个功能,我正在尝试compose它:

  private def convert(value: String)
  : Path = decode[Path](value) match {


  private def verify(parsed: Path)
  : Path = parsed.os match {

我尝试过如下:

verify compose convert _

编译器抱怨:

[error] Unapplied methods are only converted to functions when a function type is expected.
[error] You can make this conversion explicit by writing `verify _` or `verify(_)` instead of `verify`.
[error]     verify compose convert _
[error]     ^
[error] one error found

我正在努力完成以下任务:

  def process(value: String)
  : Path =
    verify(convert(value))

我做错了什么?

0 个答案:

没有答案
相关问题