Skip to content

Instantly share code, notes, and snippets.

@SuperManEver
Created October 21, 2016 15:43
Show Gist options
  • Select an option

  • Save SuperManEver/908852f7d7f079a43ee768d59cf06ed4 to your computer and use it in GitHub Desktop.

Select an option

Save SuperManEver/908852f7d7f079a43ee768d59cf06ed4 to your computer and use it in GitHub Desktop.
import Html exposing (text)
import Json.Decode exposing (..)
decodeIds : Decoder (List Int)
decodeIds = list int
convertIds : String -> Decoder (List Int) -> Result String (List Int)
convertIds str decoder =
decodeString decoder str
main =
let
ids = convertIds "[1,2,3,4]" decodeIds
in
text (toString ids)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment