我正在尝试编写一个函数来拉出可扩展记录列表,我想知道这是否可行.源代码如下,或在此处查看Ellie链接
module Temp exposing (..)
import Html exposing (text)
main =
text "Hello"
items : Maybe List { data | id : Int } -> List { data | id : Int }
items maybeList =
case maybeList of
Just t ->
t
Nothing ->
[]
Run Code Online (Sandbox Code Playgroud) elm ×1