Files
elm-0.19-workshop/intro/part9/src/CommentId.elm
Richard Feldman 17f96d1b56 Add part9
2018-08-12 14:50:14 -04:00

30 lines
341 B
Elm

module CommentId exposing (CommentId, decoder, toString)
import Json.Decode as Decode exposing (Decoder)
-- TYPES
type CommentId
= CommentId Int
-- CREATE
decoder : Decoder CommentId
decoder =
Decode.map CommentId Decode.int
-- TRANSFORM
toString : CommentId -> String
toString (CommentId id) =
String.fromInt id