Files
elm-0.19-workshop/advanced/part6/src/CommentId.elm
Richard Feldman 5226fdd2e8 Add part6
2018-08-13 06:46:16 -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