Skip to content

Instantly share code, notes, and snippets.

@poying
Last active June 25, 2016 13:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save poying/f50d12ff89152c6b14d8b46c4cc2cfc1 to your computer and use it in GitHub Desktop.
Save poying/f50d12ff89152c6b14d8b46c4cc2cfc1 to your computer and use it in GitHub Desktop.
Elm 0.17 port 筆記

ADT

port 不能使用 ADT,所以任何有巢狀結構的的資料在 port 都會遇到問題。目前的解法是在 outcome 的地方先用 JSON.stringify 轉成 String,income 再用 JSON.parse 轉成 Maybe a(噴 error 的時候就是 Nothing,這個解法有點問題,暫時先這樣 :p)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment