aboutsummaryrefslogtreecommitdiff
path: root/client/src/Messages.elm
blob: da10d223958ca14c42453ac935294ce6a9e4408b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
module Messages exposing(..)

import Json.Decode
import Json.Encode exposing (Value)
-- The following module comes from bartavelle/json-helpers
import Json.Helpers exposing (..)
import Dict exposing (Dict)
import Set exposing (Set)


type ServerMessage  =
    Welcome 

jsonDecServerMessage : Json.Decode.Decoder ( ServerMessage )
jsonDecServerMessage = 
    let jsonDecDictServerMessage = Dict.fromList [("Welcome", Welcome)]
    in  decodeSumUnaries "ServerMessage" jsonDecDictServerMessage

jsonEncServerMessage : ServerMessage -> Value
jsonEncServerMessage  val =
    case val of
        Welcome -> Json.Encode.string "Welcome"