1
Je ne sais pas comment utiliser Json.decode.Elm: Comment utiliser Json
type alias Test =
{ a : Int
, b : Int
}
testDecoder =
object2 Test
("a" := int)
("b" := int)
main : Html
main =
let
t = "{\"a\":2, \"b\":2}"
d = decodeString testDecoder t
in
p [] [ text <| toString <| d ]
Je veux obtenir la valeur de "a".
Je ne sais pas "Ok {a = 2, b = 2}".
decodeString : Decoder a -> String -> Result String a
merci! ('▽ ') ノ – takata