也许出站端口不支持任务? [英] Maybe Task not supported on outbound ports?
问题描述
我似乎收到此错误
Trying to send an unsupported type through outbound port `projectRequests`
port projectRequests : Signal (Maybe (Task String ()))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The specific unsupported type is:
Task.Task String ()
The types of values that can flow through outbound ports include: Ints, Floats, Bools, Strings, Maybes, Lists, Arrays, Tuples, Json.Values, and concrete records.
但这似乎很好
port orgRequests : Signal (Task String ())
我对这里发生的事情感到困惑.
I am confused as to what is going on here.
推荐答案
有两种方法可以使用
在这种情况下,数据( In this case you have data ( 如果要执行 If you want to execute the **您能否将此错误消息报告给错误消息目录?该消息可能会更好,因为它可以根据 *Can you please report this error message to the error message catalog? This message could be better since it can guess your intentions from the 这篇关于也许出站端口不支持任务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!Task
发送到要计划执行的运行时.
Task
s to the runtime to be scheduled for execution.Maybe
)包裹在Task
周围,因此编译器假定(错误*)要使用端口1. Maybe
) wrapped around your Task
, so the compiler assumes (wrongly*) that you want to the use the port for purpose #1. Signal
上Just
中包裹的Task
,而对Signal
上的Nothing
不执行任何操作,则可以过滤出Nothing
并展开Just
与 Signal.Extra.filter
或Signal.filterMap identity
:Task
s wrapped in Just
s on the Signal
and do nothing on a Nothing
on the Signal
, you can filter out the Nothing
and unwrap the Just
with Signal.Extra.filter
or Signal.filterMap identity
:port projectRequests : Signal (Maybe (Task String ()))
port projectRequests = Signal.filterMap identity -- and then whatever you had here before
Task
猜测您的意图是您要发送的数据类型. Task
being in the type of the data you're trying to send out.