Files
elm-0.19-workshop/advanced/part1/src/CommentId.elm
Richard Feldman d57dec1681 Rename more stuff
2018-08-05 04:49:15 -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