有没有办法使用@spec(函数规范)将函数return指定为UUID列表?

Is there a way to use @spec (Function specs) to specify the function return as list of UUIDs?

我有一个名为 'get' 的函数,它 return 是一个 UUID 列表。这个列表可以是空的,也可以有 N 个 UUID。有没有办法使用@spec 来公开这种类型的return?到目前为止,我的@specs 告诉我通用列表是 returning.

@spec get :: list
  def get do
    ...
    list_of_UUIDs
  end

Ecto.UUID.t() 定义为

@type t :: <<_::288>>

我不会重新发明轮子,我会使用

@spec get :: [<<_::288>>]

它并不完全正确(并非每个 36 字节都是有效的 UUID,)但比仅 list().[=17= 要好得多]

为清楚起见,可以明确地使用

@type uuid :: <<_::288>>

@spec get :: [uuid()]