-
Notifications
You must be signed in to change notification settings - Fork 1
/
E2eTest.elm
57 lines (46 loc) · 1.29 KB
/
E2eTest.elm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
module E2eTest exposing (..)
{-| A module that should not change at all when running the generator over it -}
import Html exposing (text)
import Dict
import Json.Decode as Decode
import Json.Encode as Encode
main = text "Success!"
-- [generator-start]
type Id = Id Int
type Dict_ a = Dict_ (Dict.Dict Int a)
type M = Maybe Int
-- [generator-generated-start] -- DO NOT MODIFY or remove this line
decodeDictInt_ParamA_ decodeA =
let
decodeDictInt_ParamA_Tuple =
Decode.map2
(\a1 a2 -> (a1, a2))
( Decode.field "A1" Decode.int )
( Decode.field "A2" decodeA )
in
Decode.map Dict.fromList (Decode.list decodeDictInt_ParamA_Tuple)
decodeDict_ decodeA =
Decode.map Dict_ (decodeDictInt_ParamA_ decodeA)
decodeId =
Decode.map Id Decode.int
decodeM =
Decode.maybe Decode.int
encodeDictInt_ParamA_ encodeA a =
let
encodeDictInt_ParamA_Tuple (a1,a2) =
Encode.object
[ ("A1", Encode.int a1)
, ("A2", encodeA a2) ]
in
(Encode.list encodeDictInt_ParamA_Tuple) (Dict.toList a)
encodeDict_ encodeA (Dict_ a1) =
encodeDictInt_ParamA_ encodeA a1
encodeId (Id a1) =
Encode.int a1
encodeM a =
case a of
Just b->
Encode.int b
Nothing->
Encode.null
-- [generator-end]