小编Gui*_*bel的帖子

榆树:更新子类型的值

我有这种类型

type alias Cat =
 { head : Head
 }

type alias Head =
  { eyes : Int
  , nose : Int
  , mouth : Mouth
  }

type alias Mouth =
  { tongue : Int
  , prey : Prey
  }

type alias Prey =
  { left : Int
  , right : Int 
  }
Run Code Online (Sandbox Code Playgroud)

插入值

cat : Cat
cat = 
  { head = 
    { eyes = 2
    , nose = 1
    , mouth = 
      { tongue = 1
      , prey = …
Run Code Online (Sandbox Code Playgroud)

elm

1
推荐指数
1
解决办法
45
查看次数

标签 统计

elm ×1