Stabel

Check-in [882b9bc963]
Login
Overview
Comment:Most definitions can now have documentation strings attached. Missing for module definitions.
Timelines: family | ancestors | descendants | both | strings
Files: files | file ages | folders
SHA3-256: 882b9bc9636c853576aa1c505e57c0b8082dd56cf76c0f14e59df2e799604c8f
User & Date: robin.hansen on 2021-09-05 16:10:39
Other Links: branch diff | manifest | tags
Context
2021-09-05
19:59
Module definitions can now contain documentation strings. check-in: 1a0f42978d user: robin.hansen tags: strings
16:10
Most definitions can now have documentation strings attached. Missing for module definitions. check-in: 882b9bc963 user: robin.hansen tags: strings
09:54
Strip indentation from multiline strings. check-in: b65fbd80ac user: robin.hansen tags: strings
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Modified src/Stabel/Parser.elm from [f1d2db574c] to [a9412e3bb3].

37
38
39
40
41
42
43

44
45
46
47
48
49
50
..
51
52
53
54
55
56
57

58
59
60
61
62
63
64
...
722
723
724
725
726
727
728

729
730
731
732
733
734
735
...
736
737
738
739
740
741
742

743
744
745
746
747
748
749
750
751
752
753
754
755

756
757
758
759
760
761
762
...
778
779
780
781
782
783
784

785
786
787
788
789
790
791
...
804
805
806
807
808
809
810






811
812
813
814
815
816
817
...
849
850
851
852
853
854
855

856
857
858
859
860
861
862
...
900
901
902
903
904
905
906






907
908
909
910
911
912
913
...
942
943
944
945
946
947
948
949
950
951

952
953
954
955
956
957
958
959
960
...
961
962
963
964
965
966
967




968
969
970
971
972
973
974
975
976
977
978
979
980






981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
....
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024






1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037

1038
1039
1040
1041
1042
1043
1044
1045
1046
....
1047
1048
1049
1050
1051
1052
1053




1054
1055
1056
1057






1058
1059
1060


1061
1062
1063
1064
1065
1066
1067






1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
    , functions : Dict String FunctionDefinition
    }


type alias TypeDefinition =
    { name : String
    , sourceLocation : SourceLocationRange

    , generics : List String
    , members : TypeDefinitionMembers
    }


type TypeDefinitionMembers
    = StructMembers (List ( String, PossiblyQualifiedType ))
................................................................................
    | UnionMembers (List PossiblyQualifiedType)


type alias FunctionDefinition =
    { name : String
    , typeSignature : AssociatedFunctionSignature
    , sourceLocationRange : Maybe SourceLocationRange

    , aliases : Dict String String
    , imports : Dict String (List String)
    , implementation : FunctionImplementation
    }


type FunctionImplementation
................................................................................
                    , typeSignature =
                        AssociatedFunctionSignature.Verified
                            { input =
                                List.map (NotStackRange << Tuple.second) typeMembers
                            , output = [ typeOfType ]
                            }
                    , sourceLocationRange = Nothing

                    , aliases = Dict.empty
                    , imports = Dict.empty
                    , implementation =
                        SoloImpl [ ConstructType typeDef.name ]
                    }

                setterGetterPair ( memberName, memberType ) =
................................................................................
                    [ { name = ">" ++ memberName
                      , typeSignature =
                            AssociatedFunctionSignature.Verified
                                { input = [ typeOfType, NotStackRange memberType ]
                                , output = [ typeOfType ]
                                }
                      , sourceLocationRange = Nothing

                      , aliases = Dict.empty
                      , imports = Dict.empty
                      , implementation =
                            SoloImpl
                                [ SetMember typeDef.name memberName ]
                      }
                    , { name = memberName ++ ">"
                      , typeSignature =
                            AssociatedFunctionSignature.Verified
                                { input = [ typeOfType ]
                                , output = [ NotStackRange memberType ]
                                }
                      , sourceLocationRange = Nothing

                      , aliases = Dict.empty
                      , imports = Dict.empty
                      , implementation =
                            SoloImpl
                                [ GetMember typeDef.name memberName ]
                      }
                    ]
................................................................................
                        }
            }

        emptyDef =
            { name = name
            , typeSignature = AssociatedFunctionSignature.NotProvided
            , sourceLocationRange = Nothing

            , aliases = Dict.empty
            , imports = Dict.empty
            , implementation = SoloImpl []
            }
    in
    Parser.inContext (Problem.FunctionDefinition startLocation name) <|
        case Dict.get name definedFunctions of
................................................................................
functionMetadataParser def =
    Parser.oneOf
        [ Parser.inContext TypeKeyword <|
            Parser.succeed (\typeSign -> Parser.Loop { def | typeSignature = AssociatedFunctionSignature.UserProvided typeSign })
                |. Parser.keyword (Token "type:" UnknownError)
                |. noiseParser
                |= typeSignatureParser






        , Parser.inContext AliasKeyword <|
            Parser.succeed (\alias value -> Parser.Loop { def | aliases = Dict.insert alias value def.aliases })
                |. Parser.keyword (Token "alias:" UnknownError)
                |. noiseParser
                |= symbolParser
                |. noiseParser
                |= modulePathStringParser
................................................................................
                , implementation = reverseWhens def.implementation
            }

        emptyDef =
            { name = name
            , typeSignature = AssociatedFunctionSignature.NotProvided
            , sourceLocationRange = Nothing

            , aliases = Dict.empty
            , imports = Dict.empty
            , implementation = SoloImpl []
            }

        reverseWhens implementation =
            case implementation of
................................................................................
    in
    Parser.oneOf
        [ Parser.inContext TypeKeyword <|
            Parser.succeed (\typeSign -> Parser.Loop { def | typeSignature = AssociatedFunctionSignature.UserProvided typeSign })
                |. Parser.keyword (Token "type:" UnknownError)
                |. noiseParser
                |= typeSignatureParser






        , Parser.inContext ElseKeyword <|
            Parser.succeed (\impl -> Parser.Loop { def | implementation = setDefaultImpl impl })
                |. Parser.keyword (Token "else:" UnknownError)
                |. noiseParser
                |= implementationParser
        , Parser.inContext AliasKeyword <|
            Parser.succeed (\alias value -> Parser.Loop { def | aliases = Dict.insert alias value def.aliases })
................................................................................
typeDefinitionParser :
    Dict String TypeDefinition
    -> Dict String FunctionDefinition
    -> ( SourceLocation, String )
    -> Parser TypeDefinition
typeDefinitionParser definedTypes definedFunctions ( startLocation, typeName ) =
    let
        ctor generics members endLocation =
            { name = typeName
            , sourceLocation = SourceLocationRange startLocation endLocation

            , generics = generics
            , members = StructMembers members
            }
    in
    Parser.inContext (Problem.StructDefinition startLocation typeName) <|
        case Dict.get typeName definedTypes of
            Just previousDefinition ->
                Parser.problem <|
                    TypeAlreadyDefined
................................................................................
                        typeName
                        previousDefinition.sourceLocation

            Nothing ->
                Parser.succeed ctor
                    |. noiseParser
                    |= Parser.loop [] typeGenericParser




                    |= Parser.loop [] (typeMemberParser definedFunctions)
                    |= sourceLocationParser


typeGenericParser : List String -> Parser (Parser.Step (List String) (List String))
typeGenericParser generics =
    Parser.oneOf
        [ Parser.succeed (\name -> Parser.Loop (name :: generics))
            |= genericParser
            |. noiseParser
        , Parser.succeed (Parser.Done (List.reverse generics))
        ]








typeMemberParser :
    Dict String FunctionDefinition
    -> List ( String, PossiblyQualifiedType )
    ->
        Parser
            (Parser.Step
                (List ( String, PossiblyQualifiedType ))
                (List ( String, PossiblyQualifiedType ))
            )
typeMemberParser functions types =
    let
        alreadyDefinedCheck name =
            let
                getterName =
                    name ++ ">"

                setterName =
................................................................................
                            setter.sourceLocationRange

                ( Nothing, Nothing ) ->
                    Parser.succeed name
    in
    Parser.oneOf
        [ Parser.inContext MemberKeyword <|
            Parser.succeed (\name type_ -> Parser.Loop (( name, type_ ) :: types))
                |. Parser.symbol (Token ":" UnknownError)
                |. noiseParser
                |= Parser.andThen alreadyDefinedCheck symbolParser
                |. noiseParser
                |= typeRefParser






        , Parser.succeed UnknownMetadata
            |= definitionMetadataParser
            |> Parser.andThen Parser.problem
        , Parser.succeed (Parser.Done (List.reverse types))
        ]


unionTypeDefinitionParser : Dict String TypeDefinition -> ( SourceLocation, String ) -> Parser TypeDefinition
unionTypeDefinitionParser definedTypes ( startLocation, typeName ) =
    let
        ctor generics members endLocation =
            { name = typeName
            , sourceLocation = SourceLocationRange startLocation endLocation

            , generics = generics
            , members = UnionMembers members
            }
    in
    Parser.inContext (Problem.UnionDefinition startLocation typeName) <|
        case Dict.get typeName definedTypes of
            Just previousDefinition ->
                Parser.problem <|
                    TypeAlreadyDefined
................................................................................
                        typeName
                        previousDefinition.sourceLocation

            Nothing ->
                Parser.succeed ctor
                    |. noiseParser
                    |= Parser.loop [] typeGenericParser




                    |= Parser.loop [] unionTypeMemberParser
                    |= sourceLocationParser








unionTypeMemberParser :
    List PossiblyQualifiedType
    -> Parser (Parser.Step (List PossiblyQualifiedType) (List PossiblyQualifiedType))


unionTypeMemberParser types =
    Parser.oneOf
        [ Parser.inContext MemberKeyword <|
            Parser.succeed (\type_ -> Parser.Loop (type_ :: types))
                |. Parser.symbol (Token ":" UnknownError)
                |. noiseParser
                |= typeRefParser






        , Parser.succeed UnknownMetadata
            |= definitionMetadataParser
            |> Parser.andThen Parser.problem
        , Parser.succeed (Parser.Done (List.reverse types))
        ]


typeSignatureParser : Parser FunctionSignature
typeSignatureParser =
    Parser.succeed (\input output -> { input = input, output = output })
        |= Parser.loop [] typeLoopParser







>







 







>







 







>







 







>













>







 







>







 







>
>
>
>
>
>







 







>







 







>
>
>
>
>
>







 







|


>

|







 







>
>
>
>
|












>
>
>
>
>
>



|



|
|

|







 







|





>
>
>
>
>
>



|






|


>

|







 







>
>
>
>
|



>
>
>
>
>
>

<
<
>
>
|


|



>
>
>
>
>
>



|







37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
..
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
...
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
...
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
...
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
...
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
...
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
...
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
...
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
...
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
....
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
....
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105


1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
    , functions : Dict String FunctionDefinition
    }


type alias TypeDefinition =
    { name : String
    , sourceLocation : SourceLocationRange
    , documentation : String
    , generics : List String
    , members : TypeDefinitionMembers
    }


type TypeDefinitionMembers
    = StructMembers (List ( String, PossiblyQualifiedType ))
................................................................................
    | UnionMembers (List PossiblyQualifiedType)


type alias FunctionDefinition =
    { name : String
    , typeSignature : AssociatedFunctionSignature
    , sourceLocationRange : Maybe SourceLocationRange
    , documentation : String
    , aliases : Dict String String
    , imports : Dict String (List String)
    , implementation : FunctionImplementation
    }


type FunctionImplementation
................................................................................
                    , typeSignature =
                        AssociatedFunctionSignature.Verified
                            { input =
                                List.map (NotStackRange << Tuple.second) typeMembers
                            , output = [ typeOfType ]
                            }
                    , sourceLocationRange = Nothing
                    , documentation = ""
                    , aliases = Dict.empty
                    , imports = Dict.empty
                    , implementation =
                        SoloImpl [ ConstructType typeDef.name ]
                    }

                setterGetterPair ( memberName, memberType ) =
................................................................................
                    [ { name = ">" ++ memberName
                      , typeSignature =
                            AssociatedFunctionSignature.Verified
                                { input = [ typeOfType, NotStackRange memberType ]
                                , output = [ typeOfType ]
                                }
                      , sourceLocationRange = Nothing
                      , documentation = ""
                      , aliases = Dict.empty
                      , imports = Dict.empty
                      , implementation =
                            SoloImpl
                                [ SetMember typeDef.name memberName ]
                      }
                    , { name = memberName ++ ">"
                      , typeSignature =
                            AssociatedFunctionSignature.Verified
                                { input = [ typeOfType ]
                                , output = [ NotStackRange memberType ]
                                }
                      , sourceLocationRange = Nothing
                      , documentation = ""
                      , aliases = Dict.empty
                      , imports = Dict.empty
                      , implementation =
                            SoloImpl
                                [ GetMember typeDef.name memberName ]
                      }
                    ]
................................................................................
                        }
            }

        emptyDef =
            { name = name
            , typeSignature = AssociatedFunctionSignature.NotProvided
            , sourceLocationRange = Nothing
            , documentation = ""
            , aliases = Dict.empty
            , imports = Dict.empty
            , implementation = SoloImpl []
            }
    in
    Parser.inContext (Problem.FunctionDefinition startLocation name) <|
        case Dict.get name definedFunctions of
................................................................................
functionMetadataParser def =
    Parser.oneOf
        [ Parser.inContext TypeKeyword <|
            Parser.succeed (\typeSign -> Parser.Loop { def | typeSignature = AssociatedFunctionSignature.UserProvided typeSign })
                |. Parser.keyword (Token "type:" UnknownError)
                |. noiseParser
                |= typeSignatureParser
        , Parser.inContext DocKeyword <|
            Parser.succeed (\str -> Parser.Loop { def | documentation = str })
                |. Parser.keyword (Token "doc:" UnknownError)
                |. noiseParser
                |= stringParser
                |. noiseParser
        , Parser.inContext AliasKeyword <|
            Parser.succeed (\alias value -> Parser.Loop { def | aliases = Dict.insert alias value def.aliases })
                |. Parser.keyword (Token "alias:" UnknownError)
                |. noiseParser
                |= symbolParser
                |. noiseParser
                |= modulePathStringParser
................................................................................
                , implementation = reverseWhens def.implementation
            }

        emptyDef =
            { name = name
            , typeSignature = AssociatedFunctionSignature.NotProvided
            , sourceLocationRange = Nothing
            , documentation = ""
            , aliases = Dict.empty
            , imports = Dict.empty
            , implementation = SoloImpl []
            }

        reverseWhens implementation =
            case implementation of
................................................................................
    in
    Parser.oneOf
        [ Parser.inContext TypeKeyword <|
            Parser.succeed (\typeSign -> Parser.Loop { def | typeSignature = AssociatedFunctionSignature.UserProvided typeSign })
                |. Parser.keyword (Token "type:" UnknownError)
                |. noiseParser
                |= typeSignatureParser
        , Parser.inContext DocKeyword <|
            Parser.succeed (\str -> Parser.Loop { def | documentation = str })
                |. Parser.keyword (Token "doc:" UnknownError)
                |. noiseParser
                |= stringParser
                |. noiseParser
        , Parser.inContext ElseKeyword <|
            Parser.succeed (\impl -> Parser.Loop { def | implementation = setDefaultImpl impl })
                |. Parser.keyword (Token "else:" UnknownError)
                |. noiseParser
                |= implementationParser
        , Parser.inContext AliasKeyword <|
            Parser.succeed (\alias value -> Parser.Loop { def | aliases = Dict.insert alias value def.aliases })
................................................................................
typeDefinitionParser :
    Dict String TypeDefinition
    -> Dict String FunctionDefinition
    -> ( SourceLocation, String )
    -> Parser TypeDefinition
typeDefinitionParser definedTypes definedFunctions ( startLocation, typeName ) =
    let
        ctor generics result endLocation =
            { name = typeName
            , sourceLocation = SourceLocationRange startLocation endLocation
            , documentation = result.documentation
            , generics = generics
            , members = StructMembers result.members
            }
    in
    Parser.inContext (Problem.StructDefinition startLocation typeName) <|
        case Dict.get typeName definedTypes of
            Just previousDefinition ->
                Parser.problem <|
                    TypeAlreadyDefined
................................................................................
                        typeName
                        previousDefinition.sourceLocation

            Nothing ->
                Parser.succeed ctor
                    |. noiseParser
                    |= Parser.loop [] typeGenericParser
                    |= Parser.loop
                        { documentation = ""
                        , members = []
                        }
                        (typeMemberParser definedFunctions)
                    |= sourceLocationParser


typeGenericParser : List String -> Parser (Parser.Step (List String) (List String))
typeGenericParser generics =
    Parser.oneOf
        [ Parser.succeed (\name -> Parser.Loop (name :: generics))
            |= genericParser
            |. noiseParser
        , Parser.succeed (Parser.Done (List.reverse generics))
        ]


type alias StructMembersParserResult =
    { documentation : String
    , members : List ( String, PossiblyQualifiedType )
    }


typeMemberParser :
    Dict String FunctionDefinition
    -> StructMembersParserResult
    ->
        Parser
            (Parser.Step
                StructMembersParserResult
                StructMembersParserResult
            )
typeMemberParser functions result =
    let
        alreadyDefinedCheck name =
            let
                getterName =
                    name ++ ">"

                setterName =
................................................................................
                            setter.sourceLocationRange

                ( Nothing, Nothing ) ->
                    Parser.succeed name
    in
    Parser.oneOf
        [ Parser.inContext MemberKeyword <|
            Parser.succeed (\name type_ -> Parser.Loop { result | members = ( name, type_ ) :: result.members })
                |. Parser.symbol (Token ":" UnknownError)
                |. noiseParser
                |= Parser.andThen alreadyDefinedCheck symbolParser
                |. noiseParser
                |= typeRefParser
        , Parser.inContext DocKeyword <|
            Parser.succeed (\str -> Parser.Loop { result | documentation = str })
                |. Parser.keyword (Token "doc:" UnknownError)
                |. noiseParser
                |= stringParser
                |. noiseParser
        , Parser.succeed UnknownMetadata
            |= definitionMetadataParser
            |> Parser.andThen Parser.problem
        , Parser.succeed (Parser.Done { result | members = List.reverse result.members })
        ]


unionTypeDefinitionParser : Dict String TypeDefinition -> ( SourceLocation, String ) -> Parser TypeDefinition
unionTypeDefinitionParser definedTypes ( startLocation, typeName ) =
    let
        ctor generics result endLocation =
            { name = typeName
            , sourceLocation = SourceLocationRange startLocation endLocation
            , documentation = result.documentation
            , generics = generics
            , members = UnionMembers result.types
            }
    in
    Parser.inContext (Problem.UnionDefinition startLocation typeName) <|
        case Dict.get typeName definedTypes of
            Just previousDefinition ->
                Parser.problem <|
                    TypeAlreadyDefined
................................................................................
                        typeName
                        previousDefinition.sourceLocation

            Nothing ->
                Parser.succeed ctor
                    |. noiseParser
                    |= Parser.loop [] typeGenericParser
                    |= Parser.loop
                        { documentation = ""
                        , types = []
                        }
                        unionTypeMemberParser
                    |= sourceLocationParser


type alias UnionMembersParserResult =
    { documentation : String
    , types : List PossiblyQualifiedType
    }


unionTypeMemberParser :


    UnionMembersParserResult
    -> Parser (Parser.Step UnionMembersParserResult UnionMembersParserResult)
unionTypeMemberParser result =
    Parser.oneOf
        [ Parser.inContext MemberKeyword <|
            Parser.succeed (\type_ -> Parser.Loop { result | types = type_ :: result.types })
                |. Parser.symbol (Token ":" UnknownError)
                |. noiseParser
                |= typeRefParser
        , Parser.inContext DocKeyword <|
            Parser.succeed (\str -> Parser.Loop { result | documentation = str })
                |. Parser.keyword (Token "doc:" UnknownError)
                |. noiseParser
                |= stringParser
                |. noiseParser
        , Parser.succeed UnknownMetadata
            |= definitionMetadataParser
            |> Parser.andThen Parser.problem
        , Parser.succeed (Parser.Done { result | types = List.reverse result.types })
        ]


typeSignatureParser : Parser FunctionSignature
typeSignatureParser =
    Parser.succeed (\input output -> { input = input, output = output })
        |= Parser.loop [] typeLoopParser

Modified src/Stabel/Parser/ModuleDefinition.elm from [7265ca2262] to [6d4b48c8bb].

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
    | Defined Definition


type alias Definition =
    { aliases : Dict String String
    , imports : Dict String (List String)
    , exposes : Set String

    }


emptyDefinition : Definition
emptyDefinition =
    { aliases = Dict.empty
    , imports = Dict.empty
    , exposes = Set.empty

    }


definition : ModuleDefinition -> Definition
definition mod =
    case mod of
        Undefined ->
            emptyDefinition

        Defined def ->
            def







>








>











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
    | Defined Definition


type alias Definition =
    { aliases : Dict String String
    , imports : Dict String (List String)
    , exposes : Set String
    , documentation : String
    }


emptyDefinition : Definition
emptyDefinition =
    { aliases = Dict.empty
    , imports = Dict.empty
    , exposes = Set.empty
    , documentation = ""
    }


definition : ModuleDefinition -> Definition
definition mod =
    case mod of
        Undefined ->
            emptyDefinition

        Defined def ->
            def

Modified src/Stabel/Parser/Problem.elm from [54e9eb3992] to [c2792cae36].

19
20
21
22
23
24
25

26
27
28
29
30
31
32
...
138
139
140
141
142
143
144



145
146
147
148
149
150
151
    | MultifunctionDefinition SourceLocation String
    | StructDefinition SourceLocation String
    | UnionDefinition SourceLocation String
    | AliasKeyword
    | ImportKeyword
    | ExposingKeyword
    | TypeKeyword

    | MemberKeyword
    | ImplementationKeyword
    | ElseKeyword


type Problem
    = ExpectedInt
................................................................................

        ExposingKeyword ->
            "exposing keyword"

        TypeKeyword ->
            "type keyword"




        MemberKeyword ->
            "member"

        ImplementationKeyword ->
            "implementation"

        ElseKeyword ->







>







 







>
>
>







19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
...
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
    | MultifunctionDefinition SourceLocation String
    | StructDefinition SourceLocation String
    | UnionDefinition SourceLocation String
    | AliasKeyword
    | ImportKeyword
    | ExposingKeyword
    | TypeKeyword
    | DocKeyword
    | MemberKeyword
    | ImplementationKeyword
    | ElseKeyword


type Problem
    = ExpectedInt
................................................................................

        ExposingKeyword ->
            "exposing keyword"

        TypeKeyword ->
            "type keyword"

        DocKeyword ->
            "doc keyword"

        MemberKeyword ->
            "member"

        ImplementationKeyword ->
            "implementation"

        ElseKeyword ->

Modified src/Stabel/Qualifier.elm from [65bd5476f4] to [24dab28864].

213
214
215
216
217
218
219

220
221
222
223
224
225
226

        def =
            ModuleDefinition.definition config.ast.moduleDefinition
    in
    { imports = Dict.union def.imports defaultImports
    , aliases = def.aliases
    , exposes = def.exposes

    }


resolveUnionInTypeDefs : Dict String TypeDefinition -> TypeDefinition -> TypeDefinition
resolveUnionInTypeDefs qt td =
    { td
        | members =







>







213
214
215
216
217
218
219
220
221
222
223
224
225
226
227

        def =
            ModuleDefinition.definition config.ast.moduleDefinition
    in
    { imports = Dict.union def.imports defaultImports
    , aliases = def.aliases
    , exposes = def.exposes
    , documentation = def.documentation
    }


resolveUnionInTypeDefs : Dict String TypeDefinition -> TypeDefinition -> TypeDefinition
resolveUnionInTypeDefs qt td =
    { td
        | members =

Modified tests/Test/Parser.elm from [636964fe74] to [0383b8f873].

47
48
49
50
51
52
53

54
55
56
57
58
59
60
..
62
63
64
65
66
67
68

69
70
71
72
73
74
75
76
77
78
79

80
81
82
83
84
85
86
...
112
113
114
115
116
117
118








































119
120
121
122
123
124
125
...
151
152
153
154
155
156
157

158
159
160
161
162
163
164
...
165
166
167
168
169
170
171

172
173
174
175
176
177
178
...
197
198
199
200
201
202
203

204
205
206
207
208
209
210
211
212
213
214
215
216

217
218
219
220
221
222
223
...
243
244
245
246
247
248
249

250
251
252
253
254
255
256
...
260
261
262
263
264
265
266

267
268
269
270
271
272
273
...
288
289
290
291
292
293
294

295
296
297
298
299
300
301
...
304
305
306
307
308
309
310

311
312
313
314
315
316
317
318
319
320
321
322

323
324
325
326
327
328
329
330
331
332
333
334

335
336
337
338
339
340
341
342
































343
344
345
346
347
348
349
...
361
362
363
364
365
366
367

368
369
370
371
372
373
374
...
400
401
402
403
404
405
406

407
408
409
410
411
412
413
414
415














































































416
417
418
419
420

421
422
423
424
425
426
427
428
429

430
431
432
433
434
435
436
...
466
467
468
469
470
471
472

473
474
475
476
477
478
479
480
481

482
483
484
485
486
487
488
489
490

491
492
493
494
495
496
497
...
530
531
532
533
534
535
536

537
538
539
540
541
542
543
544
545

546
547
548
549
550
551
552

553
554
555
556
557
558
559
560
561

562
563
564
565
566
567
568
...
602
603
604
605
606
607
608

609
610
611
612
613
614
615
616
617

618
619
620
621
622
623
624

625
626
627
628
629
630
631
632
633
634
635
636
637

638
639
640
641
642
643
644
...
683
684
685
686
687
688
689

690
691
692
693
694
695
696
697
698
699

700
701
702
703
704
705
706
...
743
744
745
746
747
748
749

750
751
752
753
754
755
756
757
758
759

760
761
762
763
764
765
766
...
790
791
792
793
794
795
796

797
798
799
800
801
802
803
...
828
829
830
831
832
833
834

835
836
837
838
839
840
841
...
872
873
874
875
876
877
878

879
880
881
882
883
884
885
...
909
910
911
912
913
914
915

916
917
918
919
920
921
922
....
1001
1002
1003
1004
1005
1006
1007

1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019

1020
1021
1022
1023
1024
1025
1026
1027

1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040

1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051

1052
1053
1054
1055
1056
1057
1058
....
1061
1062
1063
1064
1065
1066
1067

1068
1069
1070
1071
1072
1073
1074
....
1106
1107
1108
1109
1110
1111
1112

1113
1114
1115
1116
1117
1118
1119
....
1138
1139
1140
1141
1142
1143
1144

1145
1146
1147
1148
1149
1150
1151
....
1193
1194
1195
1196
1197
1198
1199

1200
1201
1202
1203
1204
1205
1206
....
1254
1255
1256
1257
1258
1259
1260

1261
1262
1263
1264
1265
1266
1267
                        , moduleDefinition = ModuleDefinition.Undefined
                        , types = Dict.empty
                        , functions =
                            Dict.fromListBy .name
                                [ { name = "inc"
                                  , typeSignature = AssociatedFunctionSignature.NotProvided
                                  , sourceLocationRange = Nothing

                                  , aliases = Dict.empty
                                  , imports = Dict.empty
                                  , implementation =
                                        SoloImpl
                                            [ AST.Integer emptyRange 1
                                            , AST.Function emptyRange "+"
                                            ]
................................................................................
                                , { name = "dec"
                                  , typeSignature =
                                        AssociatedFunctionSignature.UserProvided
                                            { input = [ NotStackRange <| LocalRef "Int" [] ]
                                            , output = [ NotStackRange <| LocalRef "Int" [] ]
                                            }
                                  , sourceLocationRange = Nothing

                                  , aliases = Dict.empty
                                  , imports = Dict.empty
                                  , implementation =
                                        SoloImpl
                                            [ AST.Integer emptyRange 1
                                            , AST.Function emptyRange "-"
                                            ]
                                  }
                                , { name = "main"
                                  , typeSignature = AssociatedFunctionSignature.NotProvided
                                  , sourceLocationRange = Nothing

                                  , aliases = Dict.empty
                                  , imports = Dict.empty
                                  , implementation =
                                        SoloImpl
                                            [ AST.Integer emptyRange 1
                                            , AST.Function emptyRange "inc"
                                            , AST.Function emptyRange "inc"
................................................................................
                                [ { name = "int="
                                  , typeSignature =
                                        AssociatedFunctionSignature.UserProvided
                                            { input = [ NotStackRange <| AST.LocalRef "Int" [], NotStackRange <| AST.LocalRef "Int" [] ]
                                            , output = [ NotStackRange <| AST.LocalRef "Bool" [] ]
                                            }
                                  , sourceLocationRange = Nothing








































                                  , aliases = Dict.empty
                                  , imports = Dict.empty
                                  , implementation =
                                        SoloImpl
                                            [ AST.Function emptyRange "-"
                                            , AST.Function emptyRange "zero?"
                                            ]
................................................................................
                                [ { name = ","
                                  , typeSignature =
                                        AssociatedFunctionSignature.UserProvided
                                            { input = [ NotStackRange <| AST.LocalRef "Int" [], NotStackRange <| AST.LocalRef "Int" [] ]
                                            , output = [ NotStackRange <| AST.LocalRef "Int" [] ]
                                            }
                                  , sourceLocationRange = Nothing

                                  , aliases = Dict.empty
                                  , imports = Dict.empty
                                  , implementation =
                                        SoloImpl
                                            [ AST.Function emptyRange "+"
                                            ]
                                  }
................................................................................
                                , { name = "add2"
                                  , typeSignature =
                                        AssociatedFunctionSignature.UserProvided
                                            { input = [ NotStackRange <| AST.LocalRef "Int" [] ]
                                            , output = [ NotStackRange <| AST.LocalRef "Int" [] ]
                                            }
                                  , sourceLocationRange = Nothing

                                  , aliases = Dict.empty
                                  , imports = Dict.empty
                                  , implementation =
                                        SoloImpl
                                            [ AST.Integer emptyRange 2
                                            , AST.Function emptyRange ","
                                            ]
................................................................................
                        expectedAst =
                            { sourceReference = ""
                            , moduleDefinition = ModuleDefinition.Undefined
                            , types =
                                Dict.fromListBy .name
                                    [ { name = "True"
                                      , sourceLocation = emptyRange

                                      , generics = []
                                      , members = AST.StructMembers []
                                      }
                                    ]
                            , functions =
                                Dict.fromListBy .name
                                    [ { name = "as-int"
                                      , typeSignature =
                                            AssociatedFunctionSignature.UserProvided
                                                { input = [ NotStackRange <| LocalRef "True" [] ]
                                                , output = [ NotStackRange <| LocalRef "Int" [] ]
                                                }
                                      , sourceLocationRange = Nothing

                                      , aliases = Dict.empty
                                      , imports = Dict.empty
                                      , implementation =
                                            SoloImpl
                                                [ AST.Integer emptyRange 1
                                                ]
                                      }
................................................................................
                        expectedAst =
                            { sourceReference = ""
                            , moduleDefinition = ModuleDefinition.Undefined
                            , types =
                                Dict.fromListBy .name
                                    [ { name = "Person"
                                      , sourceLocation = emptyRange

                                      , generics = []
                                      , members =
                                            AST.StructMembers
                                                [ ( "age", LocalRef "Int" [] )
                                                , ( "jobs", LocalRef "Int" [] )
                                                ]
                                      }
................................................................................
                                    [ { name = "get-age"
                                      , typeSignature =
                                            AssociatedFunctionSignature.UserProvided
                                                { input = [ NotStackRange <| LocalRef "Person" [] ]
                                                , output = [ NotStackRange <| LocalRef "Int" [] ]
                                                }
                                      , sourceLocationRange = Nothing

                                      , aliases = Dict.empty
                                      , imports = Dict.empty
                                      , implementation =
                                            SoloImpl
                                                [ AST.Function emptyRange "age>"
                                                ]
                                      }
................................................................................
                        expectedAst =
                            { sourceReference = ""
                            , moduleDefinition = ModuleDefinition.Undefined
                            , types =
                                Dict.fromListBy .name
                                    [ { name = "Box"
                                      , sourceLocation = emptyRange

                                      , generics = [ "a" ]
                                      , members =
                                            AST.StructMembers
                                                [ ( "element", Generic "a" )
                                                ]
                                      }
                                    ]
................................................................................
                                    [ { name = ">Box"
                                      , typeSignature =
                                            AssociatedFunctionSignature.Verified
                                                { input = [ NotStackRange <| Generic "a" ]
                                                , output = [ NotStackRange <| LocalRef "Box" [ Generic "a" ] ]
                                                }
                                      , sourceLocationRange = Nothing

                                      , aliases = Dict.empty
                                      , imports = Dict.empty
                                      , implementation =
                                            SoloImpl [ AST.ConstructType "Box" ]
                                      }
                                    , { name = ">element"
                                      , typeSignature =
                                            AssociatedFunctionSignature.Verified
                                                { input = [ NotStackRange <| LocalRef "Box" [ Generic "a" ], NotStackRange <| Generic "a" ]
                                                , output = [ NotStackRange <| LocalRef "Box" [ Generic "a" ] ]
                                                }
                                      , sourceLocationRange = Nothing

                                      , aliases = Dict.empty
                                      , imports = Dict.empty
                                      , implementation =
                                            SoloImpl [ AST.SetMember "Box" "element" ]
                                      }
                                    , { name = "element>"
                                      , typeSignature =
                                            AssociatedFunctionSignature.Verified
                                                { input = [ NotStackRange <| LocalRef "Box" [ Generic "a" ] ]
                                                , output = [ NotStackRange <| Generic "a" ]
                                                }
                                      , sourceLocationRange = Nothing

                                      , aliases = Dict.empty
                                      , imports = Dict.empty
                                      , implementation =
                                            SoloImpl [ AST.GetMember "Box" "element" ]
                                      }
                                    ]
                            }
                    in
































                    expectAst source expectedAst
            ]
        , test "Parser understands generic types" <|
            \_ ->
                let
                    source =
                        """
................................................................................
                                [ { name = "over"
                                  , typeSignature =
                                        AssociatedFunctionSignature.UserProvided
                                            { input = [ NotStackRange <| Generic "a", NotStackRange <| Generic "b" ]
                                            , output = [ NotStackRange <| Generic "a", NotStackRange <| Generic "b", NotStackRange <| Generic "a" ]
                                            }
                                  , sourceLocationRange = Nothing

                                  , aliases = Dict.empty
                                  , imports = Dict.empty
                                  , implementation =
                                        SoloImpl
                                            [ AST.Function emptyRange "dup"
                                            , AST.Function emptyRange "rotate"
                                            ]
................................................................................
                        expectedAst =
                            { sourceReference = ""
                            , moduleDefinition = ModuleDefinition.Undefined
                            , types =
                                Dict.fromListBy .name
                                    [ { name = "Bool"
                                      , sourceLocation = emptyRange

                                      , generics = []
                                      , members =
                                            AST.UnionMembers
                                                [ LocalRef "True" []
                                                , LocalRef "False" []
                                                ]
                                      }
                                    , { name = "True"
                                      , sourceLocation = emptyRange














































































                                      , generics = []
                                      , members = AST.StructMembers []
                                      }
                                    , { name = "False"
                                      , sourceLocation = emptyRange

                                      , generics = []
                                      , members = AST.StructMembers []
                                      }
                                    ]
                            , functions =
                                Dict.fromListBy .name
                                    [ { name = "to-int"
                                      , typeSignature = AssociatedFunctionSignature.NotProvided
                                      , sourceLocationRange = Nothing

                                      , aliases = Dict.empty
                                      , imports = Dict.empty
                                      , implementation =
                                            MultiImpl
                                                [ ( TypeMatch emptyRange (LocalRef "True" []) []
                                                  , [ AST.Function emptyRange "drop", AST.Integer emptyRange 1 ]
                                                  )
................................................................................
                        expectedAst =
                            { sourceReference = ""
                            , moduleDefinition = ModuleDefinition.Undefined
                            , types =
                                Dict.fromListBy .name
                                    [ { name = "Maybe"
                                      , sourceLocation = emptyRange

                                      , generics = [ "a" ]
                                      , members =
                                            AST.UnionMembers
                                                [ Generic "a"
                                                , LocalRef "Nil" []
                                                ]
                                      }
                                    , { name = "Nil"
                                      , sourceLocation = emptyRange

                                      , generics = []
                                      , members = AST.StructMembers []
                                      }
                                    ]
                            , functions =
                                Dict.fromListBy .name
                                    [ { name = "if-present"
                                      , typeSignature = AssociatedFunctionSignature.NotProvided
                                      , sourceLocationRange = Nothing

                                      , aliases = Dict.empty
                                      , imports = Dict.empty
                                      , implementation =
                                            MultiImpl
                                                [ ( TypeMatch emptyRange (Generic "a") []
                                                  , [ AST.Function emptyRange "!" ]
                                                  )
................................................................................
                        expectedAst =
                            { sourceReference = ""
                            , moduleDefinition = ModuleDefinition.Undefined
                            , types =
                                Dict.fromListBy .name
                                    [ { name = "MaybeBox"
                                      , sourceLocation = emptyRange

                                      , generics = [ "a" ]
                                      , members =
                                            AST.UnionMembers
                                                [ LocalRef "Box" [ Generic "a" ]
                                                , LocalRef "Nil" []
                                                ]
                                      }
                                    , { name = "Box"
                                      , sourceLocation = emptyRange

                                      , generics = [ "a" ]
                                      , members =
                                            AST.StructMembers
                                                [ ( "element", Generic "a" ) ]
                                      }
                                    , { name = "Nil"
                                      , sourceLocation = emptyRange

                                      , generics = []
                                      , members = AST.StructMembers []
                                      }
                                    ]
                            , functions =
                                Dict.fromListBy .name
                                    [ { name = "if-present"
                                      , typeSignature = AssociatedFunctionSignature.NotProvided
                                      , sourceLocationRange = Nothing

                                      , aliases = Dict.empty
                                      , imports = Dict.empty
                                      , implementation =
                                            MultiImpl
                                                [ ( TypeMatch emptyRange (LocalRef "Box" [ Generic "a" ]) []
                                                  , [ AST.Function emptyRange "!" ]
                                                  )
................................................................................
                        expectedAst =
                            { sourceReference = ""
                            , moduleDefinition = ModuleDefinition.Undefined
                            , types =
                                Dict.fromListBy .name
                                    [ { name = "MaybeBox"
                                      , sourceLocation = emptyRange

                                      , generics = [ "a" ]
                                      , members =
                                            AST.UnionMembers
                                                [ LocalRef "Box" [ Generic "a" ]
                                                , LocalRef "Nil" []
                                                ]
                                      }
                                    , { name = "Box"
                                      , sourceLocation = emptyRange

                                      , generics = [ "a" ]
                                      , members =
                                            AST.StructMembers
                                                [ ( "element", Generic "a" ) ]
                                      }
                                    , { name = "Nil"
                                      , sourceLocation = emptyRange

                                      , generics = []
                                      , members = AST.StructMembers []
                                      }
                                    ]
                            , functions =
                                Dict.fromListBy .name
                                    [ { name = "if-present"
                                      , typeSignature =
                                            AssociatedFunctionSignature.UserProvided
                                                { input = [ NotStackRange <| LocalRef "MaybeBox" [ Generic "a" ], NotStackRange <| Generic "a" ]
                                                , output = [ NotStackRange <| Generic "a" ]
                                                }
                                      , sourceLocationRange = Nothing

                                      , aliases = Dict.empty
                                      , imports = Dict.empty
                                      , implementation =
                                            MultiImpl
                                                [ ( TypeMatch emptyRange (LocalRef "Box" [ Generic "a" ]) []
                                                  , [ AST.Function emptyRange "!" ]
                                                  )
................................................................................
                                                        { input = [ NotStackRange <| LocalRef "Int" [] ]
                                                        , output = [ NotStackRange <| LocalRef "Int" [] ]
                                                        }
                                                ]
                                            , output = [ NotStackRange <| LocalRef "Int" [] ]
                                            }
                                  , sourceLocationRange = Nothing

                                  , aliases = Dict.empty
                                  , imports = Dict.empty
                                  , implementation =
                                        SoloImpl
                                            [ AST.Function emptyRange "!"
                                            ]
                                  }
                                , { name = "main"
                                  , typeSignature = AssociatedFunctionSignature.NotProvided
                                  , sourceLocationRange = Nothing

                                  , aliases = Dict.empty
                                  , imports = Dict.empty
                                  , implementation =
                                        SoloImpl
                                            [ AST.Integer emptyRange 1
                                            , AST.InlineFunction
                                                emptyRange
................................................................................
                                                        { input = [ StackRange "a" ]
                                                        , output = [ StackRange "b" ]
                                                        }
                                                ]
                                            , output = [ StackRange "b" ]
                                            }
                                  , sourceLocationRange = Nothing

                                  , aliases = Dict.empty
                                  , imports = Dict.empty
                                  , implementation =
                                        SoloImpl
                                            [ AST.Function emptyRange "!"
                                            ]
                                  }
                                , { name = "main"
                                  , typeSignature = AssociatedFunctionSignature.NotProvided
                                  , sourceLocationRange = Nothing

                                  , aliases = Dict.empty
                                  , imports = Dict.empty
                                  , implementation =
                                        SoloImpl
                                            [ AST.Integer emptyRange 1
                                            , AST.InlineFunction emptyRange
                                                [ AST.Integer emptyRange 1
................................................................................
                            , moduleDefinition = ModuleDefinition.Undefined
                            , types = Dict.empty
                            , functions =
                                Dict.fromListBy .name
                                    [ { name = "zero?"
                                      , typeSignature = AssociatedFunctionSignature.NotProvided
                                      , sourceLocationRange = Nothing

                                      , aliases = Dict.empty
                                      , imports = Dict.empty
                                      , implementation =
                                            MultiImpl
                                                [ ( TypeMatch
                                                        emptyRange
                                                        (LocalRef "Int" [])
................................................................................
                            , moduleDefinition = ModuleDefinition.Undefined
                            , types = Dict.empty
                            , functions =
                                Dict.fromListBy .name
                                    [ { name = "pair?"
                                      , typeSignature = AssociatedFunctionSignature.NotProvided
                                      , sourceLocationRange = Nothing

                                      , aliases = Dict.empty
                                      , imports = Dict.empty
                                      , implementation =
                                            MultiImpl
                                                [ ( TypeMatch emptyRange
                                                        (LocalRef "List" [])
                                                        [ ( "tail"
................................................................................
                            , moduleDefinition = ModuleDefinition.Undefined
                            , types = Dict.empty
                            , functions =
                                Dict.fromListBy .name
                                    [ { name = "origo?"
                                      , typeSignature = AssociatedFunctionSignature.NotProvided
                                      , sourceLocationRange = Nothing

                                      , aliases = Dict.empty
                                      , imports = Dict.empty
                                      , implementation =
                                            MultiImpl
                                                [ ( TypeMatch emptyRange
                                                        (LocalRef "Pair" [])
                                                        [ ( "first", AST.LiteralInt 0 )
................................................................................
                        , moduleDefinition = ModuleDefinition.Undefined
                        , types = Dict.empty
                        , functions =
                            Dict.fromListBy .name
                                [ { name = "some-array"
                                  , typeSignature = AssociatedFunctionSignature.NotProvided
                                  , sourceLocationRange = Nothing

                                  , aliases = Dict.empty
                                  , imports = Dict.empty
                                  , implementation =
                                        SoloImpl
                                            [ AST.ArrayLiteral emptyRange
                                                [ AST.Integer emptyRange 1
                                                , AST.Integer emptyRange 2
................................................................................
                        , types =
                            Dict.fromListBy .name
                                [ { name = "Bool"
                                  , sourceLocation =
                                        SourceLocationRange
                                            (SourceLocation 2 1)
                                            (SourceLocation 6 1)

                                  , generics = []
                                  , members =
                                        AST.UnionMembers
                                            [ LocalRef "True" []
                                            , LocalRef "False" []
                                            ]
                                  }
                                , { name = "True"
                                  , sourceLocation =
                                        SourceLocationRange
                                            (SourceLocation 6 1)
                                            (SourceLocation 7 1)

                                  , generics = []
                                  , members = AST.StructMembers []
                                  }
                                , { name = "False"
                                  , sourceLocation =
                                        SourceLocationRange
                                            (SourceLocation 7 1)
                                            (SourceLocation 9 1)

                                  , generics = []
                                  , members = AST.StructMembers []
                                  }
                                ]
                        , functions =
                            Dict.fromListBy .name
                                [ { name = "True"
                                  , typeSignature =
                                        AssociatedFunctionSignature.Verified
                                            { input = []
                                            , output = [ NotStackRange <| LocalRef "True" [] ]
                                            }
                                  , sourceLocationRange = Nothing

                                  , aliases = Dict.empty
                                  , imports = Dict.empty
                                  , implementation = SoloImpl [ ConstructType "True" ]
                                  }
                                , { name = "False"
                                  , typeSignature =
                                        AssociatedFunctionSignature.Verified
                                            { input = []
                                            , output = [ NotStackRange <| LocalRef "False" [] ]
                                            }
                                  , sourceLocationRange = Nothing

                                  , aliases = Dict.empty
                                  , imports = Dict.empty
                                  , implementation = SoloImpl [ ConstructType "False" ]
                                  }
                                , { name = "from-int"
                                  , typeSignature =
                                        AssociatedFunctionSignature.UserProvided
................................................................................
                                            }
                                  , sourceLocationRange =
                                        Just
                                            (SourceLocationRange
                                                (SourceLocation 9 1)
                                                (SourceLocation 16 1)
                                            )

                                  , aliases = Dict.empty
                                  , imports = Dict.empty
                                  , implementation =
                                        MultiImpl
                                            [ ( TypeMatch
                                                    (SourceLocationRange
                                                        (SourceLocation 11 3)
................................................................................
                                  , typeSignature = AssociatedFunctionSignature.NotProvided
                                  , sourceLocationRange =
                                        Just
                                            (SourceLocationRange
                                                (SourceLocation 16 1)
                                                (SourceLocation 19 1)
                                            )

                                  , aliases = Dict.empty
                                  , imports = Dict.empty
                                  , implementation =
                                        SoloImpl
                                            [ Function
                                                (SourceLocationRange
                                                    (SourceLocation 17 3)
................................................................................
                                  , typeSignature = AssociatedFunctionSignature.NotProvided
                                  , sourceLocationRange =
                                        Just
                                            (SourceLocationRange
                                                (SourceLocation 19 1)
                                                (SourceLocation 23 1)
                                            )

                                  , aliases = Dict.empty
                                  , imports = Dict.empty
                                  , implementation =
                                        MultiImpl
                                            [ ( TypeMatch
                                                    (SourceLocationRange
                                                        (SourceLocation 20 3)
................................................................................
                            , moduleDefinition = ModuleDefinition.Undefined
                            , types = Dict.empty
                            , functions =
                                Dict.fromListBy .name
                                    [ { name = "str"
                                      , typeSignature = AssociatedFunctionSignature.NotProvided
                                      , sourceLocationRange = Nothing

                                      , aliases = Dict.empty
                                      , imports = Dict.empty
                                      , implementation =
                                            SoloImpl
                                                [ AST.StringLiteral emptyRange output
                                                ]
                                      }
................................................................................
                            , moduleDefinition = ModuleDefinition.Undefined
                            , types = Dict.empty
                            , functions =
                                Dict.fromListBy .name
                                    [ { name = "str"
                                      , typeSignature = AssociatedFunctionSignature.NotProvided
                                      , sourceLocationRange = Nothing

                                      , aliases = Dict.empty
                                      , imports = Dict.empty
                                      , implementation =
                                            SoloImpl
                                                [ AST.StringLiteral emptyRange output
                                                ]
                                      }







>







 







>











>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>







 







>







 







>













>







 







>







 







>







 







>







 







>












>












>








>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>







 







>









>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>





>









>







 







>









>









>







 







>









>







>









>







 







>









>







>













>







 







>










>







 







>










>







 







>







 







>







 







>







 







>







 







>












>








>













>











>







 







>







 







>







 







>







 







>







 







>







47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
..
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
...
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
...
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
...
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
...
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
...
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
...
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
...
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
...
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
...
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
...
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
...
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
...
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
...
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
...
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
...
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
...
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
....
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
....
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
....
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
....
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
....
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
....
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
....
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
....
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
....
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
                        , moduleDefinition = ModuleDefinition.Undefined
                        , types = Dict.empty
                        , functions =
                            Dict.fromListBy .name
                                [ { name = "inc"
                                  , typeSignature = AssociatedFunctionSignature.NotProvided
                                  , sourceLocationRange = Nothing
                                  , documentation = ""
                                  , aliases = Dict.empty
                                  , imports = Dict.empty
                                  , implementation =
                                        SoloImpl
                                            [ AST.Integer emptyRange 1
                                            , AST.Function emptyRange "+"
                                            ]
................................................................................
                                , { name = "dec"
                                  , typeSignature =
                                        AssociatedFunctionSignature.UserProvided
                                            { input = [ NotStackRange <| LocalRef "Int" [] ]
                                            , output = [ NotStackRange <| LocalRef "Int" [] ]
                                            }
                                  , sourceLocationRange = Nothing
                                  , documentation = ""
                                  , aliases = Dict.empty
                                  , imports = Dict.empty
                                  , implementation =
                                        SoloImpl
                                            [ AST.Integer emptyRange 1
                                            , AST.Function emptyRange "-"
                                            ]
                                  }
                                , { name = "main"
                                  , typeSignature = AssociatedFunctionSignature.NotProvided
                                  , sourceLocationRange = Nothing
                                  , documentation = ""
                                  , aliases = Dict.empty
                                  , imports = Dict.empty
                                  , implementation =
                                        SoloImpl
                                            [ AST.Integer emptyRange 1
                                            , AST.Function emptyRange "inc"
                                            , AST.Function emptyRange "inc"
................................................................................
                                [ { name = "int="
                                  , typeSignature =
                                        AssociatedFunctionSignature.UserProvided
                                            { input = [ NotStackRange <| AST.LocalRef "Int" [], NotStackRange <| AST.LocalRef "Int" [] ]
                                            , output = [ NotStackRange <| AST.LocalRef "Bool" [] ]
                                            }
                                  , sourceLocationRange = Nothing
                                  , documentation = ""
                                  , aliases = Dict.empty
                                  , imports = Dict.empty
                                  , implementation =
                                        SoloImpl
                                            [ AST.Function emptyRange "-"
                                            , AST.Function emptyRange "zero?"
                                            ]
                                  }
                                ]
                        }
                in
                expectAst source expectedAst
        , test "Functions can have documentation strings" <|
            \_ ->
                let
                    source =
                        """
                        def: int=
                        type: Int Int -- Bool
                        doc: \"\"\"
                        A function that checks if two ints are the same
                        \"\"\"
                        : - zero?
                        """

                    expectedAst =
                        { sourceReference = ""
                        , moduleDefinition = ModuleDefinition.Undefined
                        , types = Dict.empty
                        , functions =
                            Dict.fromListBy .name
                                [ { name = "int="
                                  , typeSignature =
                                        AssociatedFunctionSignature.UserProvided
                                            { input = [ NotStackRange <| AST.LocalRef "Int" [], NotStackRange <| AST.LocalRef "Int" [] ]
                                            , output = [ NotStackRange <| AST.LocalRef "Bool" [] ]
                                            }
                                  , sourceLocationRange = Nothing
                                  , documentation = "A function that checks if two ints are the same"
                                  , aliases = Dict.empty
                                  , imports = Dict.empty
                                  , implementation =
                                        SoloImpl
                                            [ AST.Function emptyRange "-"
                                            , AST.Function emptyRange "zero?"
                                            ]
................................................................................
                                [ { name = ","
                                  , typeSignature =
                                        AssociatedFunctionSignature.UserProvided
                                            { input = [ NotStackRange <| AST.LocalRef "Int" [], NotStackRange <| AST.LocalRef "Int" [] ]
                                            , output = [ NotStackRange <| AST.LocalRef "Int" [] ]
                                            }
                                  , sourceLocationRange = Nothing
                                  , documentation = ""
                                  , aliases = Dict.empty
                                  , imports = Dict.empty
                                  , implementation =
                                        SoloImpl
                                            [ AST.Function emptyRange "+"
                                            ]
                                  }
................................................................................
                                , { name = "add2"
                                  , typeSignature =
                                        AssociatedFunctionSignature.UserProvided
                                            { input = [ NotStackRange <| AST.LocalRef "Int" [] ]
                                            , output = [ NotStackRange <| AST.LocalRef "Int" [] ]
                                            }
                                  , sourceLocationRange = Nothing
                                  , documentation = ""
                                  , aliases = Dict.empty
                                  , imports = Dict.empty
                                  , implementation =
                                        SoloImpl
                                            [ AST.Integer emptyRange 2
                                            , AST.Function emptyRange ","
                                            ]
................................................................................
                        expectedAst =
                            { sourceReference = ""
                            , moduleDefinition = ModuleDefinition.Undefined
                            , types =
                                Dict.fromListBy .name
                                    [ { name = "True"
                                      , sourceLocation = emptyRange
                                      , documentation = ""
                                      , generics = []
                                      , members = AST.StructMembers []
                                      }
                                    ]
                            , functions =
                                Dict.fromListBy .name
                                    [ { name = "as-int"
                                      , typeSignature =
                                            AssociatedFunctionSignature.UserProvided
                                                { input = [ NotStackRange <| LocalRef "True" [] ]
                                                , output = [ NotStackRange <| LocalRef "Int" [] ]
                                                }
                                      , sourceLocationRange = Nothing
                                      , documentation = ""
                                      , aliases = Dict.empty
                                      , imports = Dict.empty
                                      , implementation =
                                            SoloImpl
                                                [ AST.Integer emptyRange 1
                                                ]
                                      }
................................................................................
                        expectedAst =
                            { sourceReference = ""
                            , moduleDefinition = ModuleDefinition.Undefined
                            , types =
                                Dict.fromListBy .name
                                    [ { name = "Person"
                                      , sourceLocation = emptyRange
                                      , documentation = ""
                                      , generics = []
                                      , members =
                                            AST.StructMembers
                                                [ ( "age", LocalRef "Int" [] )
                                                , ( "jobs", LocalRef "Int" [] )
                                                ]
                                      }
................................................................................
                                    [ { name = "get-age"
                                      , typeSignature =
                                            AssociatedFunctionSignature.UserProvided
                                                { input = [ NotStackRange <| LocalRef "Person" [] ]
                                                , output = [ NotStackRange <| LocalRef "Int" [] ]
                                                }
                                      , sourceLocationRange = Nothing
                                      , documentation = ""
                                      , aliases = Dict.empty
                                      , imports = Dict.empty
                                      , implementation =
                                            SoloImpl
                                                [ AST.Function emptyRange "age>"
                                                ]
                                      }
................................................................................
                        expectedAst =
                            { sourceReference = ""
                            , moduleDefinition = ModuleDefinition.Undefined
                            , types =
                                Dict.fromListBy .name
                                    [ { name = "Box"
                                      , sourceLocation = emptyRange
                                      , documentation = ""
                                      , generics = [ "a" ]
                                      , members =
                                            AST.StructMembers
                                                [ ( "element", Generic "a" )
                                                ]
                                      }
                                    ]
................................................................................
                                    [ { name = ">Box"
                                      , typeSignature =
                                            AssociatedFunctionSignature.Verified
                                                { input = [ NotStackRange <| Generic "a" ]
                                                , output = [ NotStackRange <| LocalRef "Box" [ Generic "a" ] ]
                                                }
                                      , sourceLocationRange = Nothing
                                      , documentation = ""
                                      , aliases = Dict.empty
                                      , imports = Dict.empty
                                      , implementation =
                                            SoloImpl [ AST.ConstructType "Box" ]
                                      }
                                    , { name = ">element"
                                      , typeSignature =
                                            AssociatedFunctionSignature.Verified
                                                { input = [ NotStackRange <| LocalRef "Box" [ Generic "a" ], NotStackRange <| Generic "a" ]
                                                , output = [ NotStackRange <| LocalRef "Box" [ Generic "a" ] ]
                                                }
                                      , sourceLocationRange = Nothing
                                      , documentation = ""
                                      , aliases = Dict.empty
                                      , imports = Dict.empty
                                      , implementation =
                                            SoloImpl [ AST.SetMember "Box" "element" ]
                                      }
                                    , { name = "element>"
                                      , typeSignature =
                                            AssociatedFunctionSignature.Verified
                                                { input = [ NotStackRange <| LocalRef "Box" [ Generic "a" ] ]
                                                , output = [ NotStackRange <| Generic "a" ]
                                                }
                                      , sourceLocationRange = Nothing
                                      , documentation = ""
                                      , aliases = Dict.empty
                                      , imports = Dict.empty
                                      , implementation =
                                            SoloImpl [ AST.GetMember "Box" "element" ]
                                      }
                                    ]
                            }
                    in
                    expectAst source expectedAst
            , test "Documentation" <|
                \_ ->
                    let
                        source =
                            """
                            defstruct: Box a
                            doc: \"\"\"
                            Boxes a value
                            \"\"\"
                            : element a
                            """

                        expectedAst =
                            { sourceReference = ""
                            , moduleDefinition = ModuleDefinition.Undefined
                            , types =
                                Dict.fromListBy .name
                                    [ { name = "Box"
                                      , sourceLocation = emptyRange
                                      , documentation = "Boxes a value"
                                      , generics = [ "a" ]
                                      , members =
                                            AST.StructMembers
                                                [ ( "element", Generic "a" )
                                                ]
                                      }
                                    ]
                            , functions = Dict.empty
                            }
                                |> addFunctionsForStructs
                    in
                    expectAst source expectedAst
            ]
        , test "Parser understands generic types" <|
            \_ ->
                let
                    source =
                        """
................................................................................
                                [ { name = "over"
                                  , typeSignature =
                                        AssociatedFunctionSignature.UserProvided
                                            { input = [ NotStackRange <| Generic "a", NotStackRange <| Generic "b" ]
                                            , output = [ NotStackRange <| Generic "a", NotStackRange <| Generic "b", NotStackRange <| Generic "a" ]
                                            }
                                  , sourceLocationRange = Nothing
                                  , documentation = ""
                                  , aliases = Dict.empty
                                  , imports = Dict.empty
                                  , implementation =
                                        SoloImpl
                                            [ AST.Function emptyRange "dup"
                                            , AST.Function emptyRange "rotate"
                                            ]
................................................................................
                        expectedAst =
                            { sourceReference = ""
                            , moduleDefinition = ModuleDefinition.Undefined
                            , types =
                                Dict.fromListBy .name
                                    [ { name = "Bool"
                                      , sourceLocation = emptyRange
                                      , documentation = ""
                                      , generics = []
                                      , members =
                                            AST.UnionMembers
                                                [ LocalRef "True" []
                                                , LocalRef "False" []
                                                ]
                                      }
                                    , { name = "True"
                                      , sourceLocation = emptyRange
                                      , documentation = ""
                                      , generics = []
                                      , members = AST.StructMembers []
                                      }
                                    , { name = "False"
                                      , sourceLocation = emptyRange
                                      , documentation = ""
                                      , generics = []
                                      , members = AST.StructMembers []
                                      }
                                    ]
                            , functions =
                                Dict.fromListBy .name
                                    [ { name = "to-int"
                                      , typeSignature = AssociatedFunctionSignature.NotProvided
                                      , sourceLocationRange = Nothing
                                      , documentation = ""
                                      , aliases = Dict.empty
                                      , imports = Dict.empty
                                      , implementation =
                                            MultiImpl
                                                [ ( TypeMatch emptyRange (LocalRef "True" []) []
                                                  , [ AST.Function emptyRange "drop", AST.Integer emptyRange 1 ]
                                                  )
                                                , ( TypeMatch emptyRange (LocalRef "False" []) []
                                                  , [ AST.Function emptyRange "drop", AST.Integer emptyRange 0 ]
                                                  )
                                                ]
                                                []
                                      }
                                    ]
                            }
                                |> addFunctionsForStructs
                    in
                    expectAst source expectedAst
            , test "Can have documentation strings" <|
                \_ ->
                    let
                        source =
                            """
                            defunion: Bool
                            doc: \"\"\"
                            Short for boolean
                            \"\"\"
                            : True 
                            : False 

                            defstruct: True
                            defstruct: False

                            defmulti: to-int
                            doc: \"\"\"
                            Converts a boolean into an int
                            \"\"\"
                            : True
                              drop 1
                            : False
                              drop 0
                            """

                        expectedAst =
                            { sourceReference = ""
                            , moduleDefinition = ModuleDefinition.Undefined
                            , types =
                                Dict.fromListBy .name
                                    [ { name = "Bool"
                                      , sourceLocation = emptyRange
                                      , documentation = "Short for boolean"
                                      , generics = []
                                      , members =
                                            AST.UnionMembers
                                                [ LocalRef "True" []
                                                , LocalRef "False" []
                                                ]
                                      }
                                    , { name = "True"
                                      , sourceLocation = emptyRange
                                      , documentation = ""
                                      , generics = []
                                      , members = AST.StructMembers []
                                      }
                                    , { name = "False"
                                      , sourceLocation = emptyRange
                                      , documentation = ""
                                      , generics = []
                                      , members = AST.StructMembers []
                                      }
                                    ]
                            , functions =
                                Dict.fromListBy .name
                                    [ { name = "to-int"
                                      , typeSignature = AssociatedFunctionSignature.NotProvided
                                      , sourceLocationRange = Nothing
                                      , documentation = "Converts a boolean into an int"
                                      , aliases = Dict.empty
                                      , imports = Dict.empty
                                      , implementation =
                                            MultiImpl
                                                [ ( TypeMatch emptyRange (LocalRef "True" []) []
                                                  , [ AST.Function emptyRange "drop", AST.Integer emptyRange 1 ]
                                                  )
................................................................................
                        expectedAst =
                            { sourceReference = ""
                            , moduleDefinition = ModuleDefinition.Undefined
                            , types =
                                Dict.fromListBy .name
                                    [ { name = "Maybe"
                                      , sourceLocation = emptyRange
                                      , documentation = ""
                                      , generics = [ "a" ]
                                      , members =
                                            AST.UnionMembers
                                                [ Generic "a"
                                                , LocalRef "Nil" []
                                                ]
                                      }
                                    , { name = "Nil"
                                      , sourceLocation = emptyRange
                                      , documentation = ""
                                      , generics = []
                                      , members = AST.StructMembers []
                                      }
                                    ]
                            , functions =
                                Dict.fromListBy .name
                                    [ { name = "if-present"
                                      , typeSignature = AssociatedFunctionSignature.NotProvided
                                      , sourceLocationRange = Nothing
                                      , documentation = ""
                                      , aliases = Dict.empty
                                      , imports = Dict.empty
                                      , implementation =
                                            MultiImpl
                                                [ ( TypeMatch emptyRange (Generic "a") []
                                                  , [ AST.Function emptyRange "!" ]
                                                  )
................................................................................
                        expectedAst =
                            { sourceReference = ""
                            , moduleDefinition = ModuleDefinition.Undefined
                            , types =
                                Dict.fromListBy .name
                                    [ { name = "MaybeBox"
                                      , sourceLocation = emptyRange
                                      , documentation = ""
                                      , generics = [ "a" ]
                                      , members =
                                            AST.UnionMembers
                                                [ LocalRef "Box" [ Generic "a" ]
                                                , LocalRef "Nil" []
                                                ]
                                      }
                                    , { name = "Box"
                                      , sourceLocation = emptyRange
                                      , documentation = ""
                                      , generics = [ "a" ]
                                      , members =
                                            AST.StructMembers
                                                [ ( "element", Generic "a" ) ]
                                      }
                                    , { name = "Nil"
                                      , sourceLocation = emptyRange
                                      , documentation = ""
                                      , generics = []
                                      , members = AST.StructMembers []
                                      }
                                    ]
                            , functions =
                                Dict.fromListBy .name
                                    [ { name = "if-present"
                                      , typeSignature = AssociatedFunctionSignature.NotProvided
                                      , sourceLocationRange = Nothing
                                      , documentation = ""
                                      , aliases = Dict.empty
                                      , imports = Dict.empty
                                      , implementation =
                                            MultiImpl
                                                [ ( TypeMatch emptyRange (LocalRef "Box" [ Generic "a" ]) []
                                                  , [ AST.Function emptyRange "!" ]
                                                  )
................................................................................
                        expectedAst =
                            { sourceReference = ""
                            , moduleDefinition = ModuleDefinition.Undefined
                            , types =
                                Dict.fromListBy .name
                                    [ { name = "MaybeBox"
                                      , sourceLocation = emptyRange
                                      , documentation = ""
                                      , generics = [ "a" ]
                                      , members =
                                            AST.UnionMembers
                                                [ LocalRef "Box" [ Generic "a" ]
                                                , LocalRef "Nil" []
                                                ]
                                      }
                                    , { name = "Box"
                                      , sourceLocation = emptyRange
                                      , documentation = ""
                                      , generics = [ "a" ]
                                      , members =
                                            AST.StructMembers
                                                [ ( "element", Generic "a" ) ]
                                      }
                                    , { name = "Nil"
                                      , sourceLocation = emptyRange
                                      , documentation = ""
                                      , generics = []
                                      , members = AST.StructMembers []
                                      }
                                    ]
                            , functions =
                                Dict.fromListBy .name
                                    [ { name = "if-present"
                                      , typeSignature =
                                            AssociatedFunctionSignature.UserProvided
                                                { input = [ NotStackRange <| LocalRef "MaybeBox" [ Generic "a" ], NotStackRange <| Generic "a" ]
                                                , output = [ NotStackRange <| Generic "a" ]
                                                }
                                      , sourceLocationRange = Nothing
                                      , documentation = ""
                                      , aliases = Dict.empty
                                      , imports = Dict.empty
                                      , implementation =
                                            MultiImpl
                                                [ ( TypeMatch emptyRange (LocalRef "Box" [ Generic "a" ]) []
                                                  , [ AST.Function emptyRange "!" ]
                                                  )
................................................................................
                                                        { input = [ NotStackRange <| LocalRef "Int" [] ]
                                                        , output = [ NotStackRange <| LocalRef "Int" [] ]
                                                        }
                                                ]
                                            , output = [ NotStackRange <| LocalRef "Int" [] ]
                                            }
                                  , sourceLocationRange = Nothing
                                  , documentation = ""
                                  , aliases = Dict.empty
                                  , imports = Dict.empty
                                  , implementation =
                                        SoloImpl
                                            [ AST.Function emptyRange "!"
                                            ]
                                  }
                                , { name = "main"
                                  , typeSignature = AssociatedFunctionSignature.NotProvided
                                  , sourceLocationRange = Nothing
                                  , documentation = ""
                                  , aliases = Dict.empty
                                  , imports = Dict.empty
                                  , implementation =
                                        SoloImpl
                                            [ AST.Integer emptyRange 1
                                            , AST.InlineFunction
                                                emptyRange
................................................................................
                                                        { input = [ StackRange "a" ]
                                                        , output = [ StackRange "b" ]
                                                        }
                                                ]
                                            , output = [ StackRange "b" ]
                                            }
                                  , sourceLocationRange = Nothing
                                  , documentation = ""
                                  , aliases = Dict.empty
                                  , imports = Dict.empty
                                  , implementation =
                                        SoloImpl
                                            [ AST.Function emptyRange "!"
                                            ]
                                  }
                                , { name = "main"
                                  , typeSignature = AssociatedFunctionSignature.NotProvided
                                  , sourceLocationRange = Nothing
                                  , documentation = ""
                                  , aliases = Dict.empty
                                  , imports = Dict.empty
                                  , implementation =
                                        SoloImpl
                                            [ AST.Integer emptyRange 1
                                            , AST.InlineFunction emptyRange
                                                [ AST.Integer emptyRange 1
................................................................................
                            , moduleDefinition = ModuleDefinition.Undefined
                            , types = Dict.empty
                            , functions =
                                Dict.fromListBy .name
                                    [ { name = "zero?"
                                      , typeSignature = AssociatedFunctionSignature.NotProvided
                                      , sourceLocationRange = Nothing
                                      , documentation = ""
                                      , aliases = Dict.empty
                                      , imports = Dict.empty
                                      , implementation =
                                            MultiImpl
                                                [ ( TypeMatch
                                                        emptyRange
                                                        (LocalRef "Int" [])
................................................................................
                            , moduleDefinition = ModuleDefinition.Undefined
                            , types = Dict.empty
                            , functions =
                                Dict.fromListBy .name
                                    [ { name = "pair?"
                                      , typeSignature = AssociatedFunctionSignature.NotProvided
                                      , sourceLocationRange = Nothing
                                      , documentation = ""
                                      , aliases = Dict.empty
                                      , imports = Dict.empty
                                      , implementation =
                                            MultiImpl
                                                [ ( TypeMatch emptyRange
                                                        (LocalRef "List" [])
                                                        [ ( "tail"
................................................................................
                            , moduleDefinition = ModuleDefinition.Undefined
                            , types = Dict.empty
                            , functions =
                                Dict.fromListBy .name
                                    [ { name = "origo?"
                                      , typeSignature = AssociatedFunctionSignature.NotProvided
                                      , sourceLocationRange = Nothing
                                      , documentation = ""
                                      , aliases = Dict.empty
                                      , imports = Dict.empty
                                      , implementation =
                                            MultiImpl
                                                [ ( TypeMatch emptyRange
                                                        (LocalRef "Pair" [])
                                                        [ ( "first", AST.LiteralInt 0 )
................................................................................
                        , moduleDefinition = ModuleDefinition.Undefined
                        , types = Dict.empty
                        , functions =
                            Dict.fromListBy .name
                                [ { name = "some-array"
                                  , typeSignature = AssociatedFunctionSignature.NotProvided
                                  , sourceLocationRange = Nothing
                                  , documentation = ""
                                  , aliases = Dict.empty
                                  , imports = Dict.empty
                                  , implementation =
                                        SoloImpl
                                            [ AST.ArrayLiteral emptyRange
                                                [ AST.Integer emptyRange 1
                                                , AST.Integer emptyRange 2
................................................................................
                        , types =
                            Dict.fromListBy .name
                                [ { name = "Bool"
                                  , sourceLocation =
                                        SourceLocationRange
                                            (SourceLocation 2 1)
                                            (SourceLocation 6 1)
                                  , documentation = ""
                                  , generics = []
                                  , members =
                                        AST.UnionMembers
                                            [ LocalRef "True" []
                                            , LocalRef "False" []
                                            ]
                                  }
                                , { name = "True"
                                  , sourceLocation =
                                        SourceLocationRange
                                            (SourceLocation 6 1)
                                            (SourceLocation 7 1)
                                  , documentation = ""
                                  , generics = []
                                  , members = AST.StructMembers []
                                  }
                                , { name = "False"
                                  , sourceLocation =
                                        SourceLocationRange
                                            (SourceLocation 7 1)
                                            (SourceLocation 9 1)
                                  , documentation = ""
                                  , generics = []
                                  , members = AST.StructMembers []
                                  }
                                ]
                        , functions =
                            Dict.fromListBy .name
                                [ { name = "True"
                                  , typeSignature =
                                        AssociatedFunctionSignature.Verified
                                            { input = []
                                            , output = [ NotStackRange <| LocalRef "True" [] ]
                                            }
                                  , sourceLocationRange = Nothing
                                  , documentation = ""
                                  , aliases = Dict.empty
                                  , imports = Dict.empty
                                  , implementation = SoloImpl [ ConstructType "True" ]
                                  }
                                , { name = "False"
                                  , typeSignature =
                                        AssociatedFunctionSignature.Verified
                                            { input = []
                                            , output = [ NotStackRange <| LocalRef "False" [] ]
                                            }
                                  , sourceLocationRange = Nothing
                                  , documentation = ""
                                  , aliases = Dict.empty
                                  , imports = Dict.empty
                                  , implementation = SoloImpl [ ConstructType "False" ]
                                  }
                                , { name = "from-int"
                                  , typeSignature =
                                        AssociatedFunctionSignature.UserProvided
................................................................................
                                            }
                                  , sourceLocationRange =
                                        Just
                                            (SourceLocationRange
                                                (SourceLocation 9 1)
                                                (SourceLocation 16 1)
                                            )
                                  , documentation = ""
                                  , aliases = Dict.empty
                                  , imports = Dict.empty
                                  , implementation =
                                        MultiImpl
                                            [ ( TypeMatch
                                                    (SourceLocationRange
                                                        (SourceLocation 11 3)
................................................................................
                                  , typeSignature = AssociatedFunctionSignature.NotProvided
                                  , sourceLocationRange =
                                        Just
                                            (SourceLocationRange
                                                (SourceLocation 16 1)
                                                (SourceLocation 19 1)
                                            )
                                  , documentation = ""
                                  , aliases = Dict.empty
                                  , imports = Dict.empty
                                  , implementation =
                                        SoloImpl
                                            [ Function
                                                (SourceLocationRange
                                                    (SourceLocation 17 3)
................................................................................
                                  , typeSignature = AssociatedFunctionSignature.NotProvided
                                  , sourceLocationRange =
                                        Just
                                            (SourceLocationRange
                                                (SourceLocation 19 1)
                                                (SourceLocation 23 1)
                                            )
                                  , documentation = ""
                                  , aliases = Dict.empty
                                  , imports = Dict.empty
                                  , implementation =
                                        MultiImpl
                                            [ ( TypeMatch
                                                    (SourceLocationRange
                                                        (SourceLocation 20 3)
................................................................................
                            , moduleDefinition = ModuleDefinition.Undefined
                            , types = Dict.empty
                            , functions =
                                Dict.fromListBy .name
                                    [ { name = "str"
                                      , typeSignature = AssociatedFunctionSignature.NotProvided
                                      , sourceLocationRange = Nothing
                                      , documentation = ""
                                      , aliases = Dict.empty
                                      , imports = Dict.empty
                                      , implementation =
                                            SoloImpl
                                                [ AST.StringLiteral emptyRange output
                                                ]
                                      }
................................................................................
                            , moduleDefinition = ModuleDefinition.Undefined
                            , types = Dict.empty
                            , functions =
                                Dict.fromListBy .name
                                    [ { name = "str"
                                      , typeSignature = AssociatedFunctionSignature.NotProvided
                                      , sourceLocationRange = Nothing
                                      , documentation = ""
                                      , aliases = Dict.empty
                                      , imports = Dict.empty
                                      , implementation =
                                            SoloImpl
                                                [ AST.StringLiteral emptyRange output
                                                ]
                                      }

Modified tests/Test/Parser/ModuleDefinition.elm from [8a3ead45b0] to [54148a9242].

53
54
55
56
57
58
59

60
61
62
63
64

65
66
67
68
69
70
71
72
73
74
75
76
77

78
79
80
81
82
83
84
...
107
108
109
110
111
112
113

114
115
116
117
118
119
120
...
155
156
157
158
159
160
161

162
163
164
165
166
167
168
...
199
200
201
202
203
204
205

206
207
208
209
210
211
212
213
214
215
216
                                , imports =
                                    Dict.fromList
                                        [ ( "/some/other/mod", [ "test1", "word2" ] )
                                        , ( "internals", [ "foo" ] )
                                        , ( "internal/mod", [] )
                                        ]
                                , exposes = Set.fromList [ "inc" ]

                                }
                        , types =
                            Dict.fromListBy .name
                                [ { name = "Pair"
                                  , sourceLocation = emptyRange

                                  , generics = [ "a", "b" ]
                                  , members =
                                        AST.StructMembers
                                            [ ( "first", Generic "a" )
                                            , ( "second", Generic "b" )
                                            ]
                                  }
                                ]
                        , functions =
                            Dict.fromListBy .name
                                [ { name = "inc"
                                  , typeSignature = AssociatedFunctionSignature.NotProvided
                                  , sourceLocationRange = Nothing

                                  , aliases = Dict.empty
                                  , imports = Dict.empty
                                  , implementation =
                                        SoloImpl
                                            [ AST.Integer emptyRange 1
                                            , AST.Function emptyRange "+"
                                            ]
................................................................................
                        , moduleDefinition = ModuleDefinition.Undefined
                        , types = Dict.empty
                        , functions =
                            Dict.fromListBy .name
                                [ { name = "inc"
                                  , typeSignature = AssociatedFunctionSignature.NotProvided
                                  , sourceLocationRange = Nothing

                                  , aliases =
                                        Dict.fromList
                                            [ ( "other", "/some/mod" )
                                            , ( "moar", "local/mod" )
                                            ]
                                  , imports =
                                        Dict.fromList
................................................................................
                        , moduleDefinition = ModuleDefinition.Undefined
                        , types = Dict.empty
                        , functions =
                            Dict.fromListBy .name
                                [ { name = "with-default"
                                  , typeSignature = AssociatedFunctionSignature.NotProvided
                                  , sourceLocationRange = Nothing

                                  , aliases =
                                        Dict.fromList
                                            [ ( "other", "/some/mod" )
                                            , ( "moar", "local/mod" )
                                            ]
                                  , imports =
                                        Dict.fromList
................................................................................
                        , moduleDefinition = ModuleDefinition.Undefined
                        , types = Dict.empty
                        , functions =
                            Dict.fromListBy .name
                                [ { name = "test"
                                  , typeSignature = AssociatedFunctionSignature.NotProvided
                                  , sourceLocationRange = Nothing

                                  , aliases = Dict.empty
                                  , imports = Dict.empty
                                  , implementation =
                                        SoloImpl
                                            [ AST.ExternalFunction emptyRange [ "ext" ] "fn1" ]
                                  }
                                ]
                        }
                in
                expectAst source expectedAst
        ]







>





>













>







 







>







 







>







 







>











53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
...
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
...
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
...
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
                                , imports =
                                    Dict.fromList
                                        [ ( "/some/other/mod", [ "test1", "word2" ] )
                                        , ( "internals", [ "foo" ] )
                                        , ( "internal/mod", [] )
                                        ]
                                , exposes = Set.fromList [ "inc" ]
                                , documentation = ""
                                }
                        , types =
                            Dict.fromListBy .name
                                [ { name = "Pair"
                                  , sourceLocation = emptyRange
                                  , documentation = ""
                                  , generics = [ "a", "b" ]
                                  , members =
                                        AST.StructMembers
                                            [ ( "first", Generic "a" )
                                            , ( "second", Generic "b" )
                                            ]
                                  }
                                ]
                        , functions =
                            Dict.fromListBy .name
                                [ { name = "inc"
                                  , typeSignature = AssociatedFunctionSignature.NotProvided
                                  , sourceLocationRange = Nothing
                                  , documentation = ""
                                  , aliases = Dict.empty
                                  , imports = Dict.empty
                                  , implementation =
                                        SoloImpl
                                            [ AST.Integer emptyRange 1
                                            , AST.Function emptyRange "+"
                                            ]
................................................................................
                        , moduleDefinition = ModuleDefinition.Undefined
                        , types = Dict.empty
                        , functions =
                            Dict.fromListBy .name
                                [ { name = "inc"
                                  , typeSignature = AssociatedFunctionSignature.NotProvided
                                  , sourceLocationRange = Nothing
                                  , documentation = ""
                                  , aliases =
                                        Dict.fromList
                                            [ ( "other", "/some/mod" )
                                            , ( "moar", "local/mod" )
                                            ]
                                  , imports =
                                        Dict.fromList
................................................................................
                        , moduleDefinition = ModuleDefinition.Undefined
                        , types = Dict.empty
                        , functions =
                            Dict.fromListBy .name
                                [ { name = "with-default"
                                  , typeSignature = AssociatedFunctionSignature.NotProvided
                                  , sourceLocationRange = Nothing
                                  , documentation = ""
                                  , aliases =
                                        Dict.fromList
                                            [ ( "other", "/some/mod" )
                                            , ( "moar", "local/mod" )
                                            ]
                                  , imports =
                                        Dict.fromList
................................................................................
                        , moduleDefinition = ModuleDefinition.Undefined
                        , types = Dict.empty
                        , functions =
                            Dict.fromListBy .name
                                [ { name = "test"
                                  , typeSignature = AssociatedFunctionSignature.NotProvided
                                  , sourceLocationRange = Nothing
                                  , documentation = ""
                                  , aliases = Dict.empty
                                  , imports = Dict.empty
                                  , implementation =
                                        SoloImpl
                                            [ AST.ExternalFunction emptyRange [ "ext" ] "fn1" ]
                                  }
                                ]
                        }
                in
                expectAst source expectedAst
        ]

Modified tests/Test/Parser/QualifiedRefs.elm from [df4f0e7d49] to [6b5fcdd2e5].

28
29
30
31
32
33
34

35
36
37
38
39
40
41
..
56
57
58
59
60
61
62

63
64
65
66
67
68
69
..
84
85
86
87
88
89
90

91
92
93
94
95
96
97
...
119
120
121
122
123
124
125

126
127
128
129
130
131
132
...
154
155
156
157
158
159
160

161
162
163
164
165
166
167
...
192
193
194
195
196
197
198

199
200
201
202
203
204
205
...
236
237
238
239
240
241
242

243
244
245
246
247
248
249
                        , moduleDefinition = ModuleDefinition.Undefined
                        , types = Dict.empty
                        , functions =
                            Dict.fromListBy .name
                                [ { name = "test"
                                  , typeSignature = AssociatedFunctionSignature.NotProvided
                                  , sourceLocationRange = Nothing

                                  , aliases = Dict.empty
                                  , imports = Dict.empty
                                  , implementation =
                                        SoloImpl
                                            [ AST.PackageFunction emptyRange [ "some", "module" ] "sample" ]
                                  }
                                ]
................................................................................
                        , moduleDefinition = ModuleDefinition.Undefined
                        , types = Dict.empty
                        , functions =
                            Dict.fromListBy .name
                                [ { name = "test"
                                  , typeSignature = AssociatedFunctionSignature.NotProvided
                                  , sourceLocationRange = Nothing

                                  , aliases = Dict.empty
                                  , imports = Dict.empty
                                  , implementation =
                                        SoloImpl
                                            [ AST.ExternalFunction emptyRange [ "some", "module" ] "sample" ]
                                  }
                                ]
................................................................................
                        , moduleDefinition = ModuleDefinition.Undefined
                        , types = Dict.empty
                        , functions =
                            Dict.fromListBy .name
                                [ { name = "test"
                                  , typeSignature = AssociatedFunctionSignature.NotProvided
                                  , sourceLocationRange = Nothing

                                  , aliases = Dict.empty
                                  , imports = Dict.empty
                                  , implementation =
                                        SoloImpl
                                            [ AST.PackageFunction emptyRange [ "internal" ] "sample"
                                            , AST.ExternalFunction emptyRange [ "some", "module" ] "sample"
                                            ]
................................................................................
                                [ { name = "test"
                                  , typeSignature =
                                        AssociatedFunctionSignature.UserProvided
                                            { input = [ NotStackRange <| InternalRef [ "internal" ] "Tipe" [] ]
                                            , output = [ NotStackRange <| LocalRef "Int" [] ]
                                            }
                                  , sourceLocationRange = Nothing

                                  , aliases = Dict.empty
                                  , imports = Dict.empty
                                  , implementation =
                                        SoloImpl
                                            [ AST.Function emptyRange "drop"
                                            , AST.Integer emptyRange 1
                                            ]
................................................................................
                                [ { name = "test"
                                  , typeSignature =
                                        AssociatedFunctionSignature.UserProvided
                                            { input = [ NotStackRange <| ExternalRef [ "external" ] "Tipe" [] ]
                                            , output = [ NotStackRange <| LocalRef "Int" [] ]
                                            }
                                  , sourceLocationRange = Nothing

                                  , aliases = Dict.empty
                                  , imports = Dict.empty
                                  , implementation =
                                        SoloImpl
                                            [ AST.Function emptyRange "drop"
                                            , AST.Integer emptyRange 1
                                            ]
................................................................................
                                [ { name = "test"
                                  , typeSignature =
                                        AssociatedFunctionSignature.UserProvided
                                            { input = [ NotStackRange <| ExternalRef [ "external" ] "Tipe" [] ]
                                            , output = [ NotStackRange <| LocalRef "Int" [] ]
                                            }
                                  , sourceLocationRange = Nothing

                                  , aliases = Dict.empty
                                  , imports = Dict.empty
                                  , implementation =
                                        MultiImpl
                                            [ ( TypeMatch emptyRange (ExternalRef [ "external" ] "Tipe" []) [ ( "value", LiteralInt 1 ) ]
                                              , [ AST.Function emptyRange "drop"
                                                , AST.Integer emptyRange 1
................................................................................
                                [ { name = "test"
                                  , typeSignature =
                                        AssociatedFunctionSignature.UserProvided
                                            { input = [ NotStackRange <| InternalRef [ "internal" ] "Tipe" [] ]
                                            , output = [ NotStackRange <| LocalRef "Int" [] ]
                                            }
                                  , sourceLocationRange = Nothing

                                  , aliases = Dict.empty
                                  , imports = Dict.empty
                                  , implementation =
                                        MultiImpl
                                            [ ( TypeMatch emptyRange (InternalRef [ "internal" ] "Tipe" []) [ ( "value", LiteralInt 1 ) ]
                                              , [ AST.Function emptyRange "drop"
                                                , AST.Integer emptyRange 1







>







 







>







 







>







 







>







 







>







 







>







 







>







28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
..
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
..
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
...
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
...
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
...
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
...
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
                        , moduleDefinition = ModuleDefinition.Undefined
                        , types = Dict.empty
                        , functions =
                            Dict.fromListBy .name
                                [ { name = "test"
                                  , typeSignature = AssociatedFunctionSignature.NotProvided
                                  , sourceLocationRange = Nothing
                                  , documentation = ""
                                  , aliases = Dict.empty
                                  , imports = Dict.empty
                                  , implementation =
                                        SoloImpl
                                            [ AST.PackageFunction emptyRange [ "some", "module" ] "sample" ]
                                  }
                                ]
................................................................................
                        , moduleDefinition = ModuleDefinition.Undefined
                        , types = Dict.empty
                        , functions =
                            Dict.fromListBy .name
                                [ { name = "test"
                                  , typeSignature = AssociatedFunctionSignature.NotProvided
                                  , sourceLocationRange = Nothing
                                  , documentation = ""
                                  , aliases = Dict.empty
                                  , imports = Dict.empty
                                  , implementation =
                                        SoloImpl
                                            [ AST.ExternalFunction emptyRange [ "some", "module" ] "sample" ]
                                  }
                                ]
................................................................................
                        , moduleDefinition = ModuleDefinition.Undefined
                        , types = Dict.empty
                        , functions =
                            Dict.fromListBy .name
                                [ { name = "test"
                                  , typeSignature = AssociatedFunctionSignature.NotProvided
                                  , sourceLocationRange = Nothing
                                  , documentation = ""
                                  , aliases = Dict.empty
                                  , imports = Dict.empty
                                  , implementation =
                                        SoloImpl
                                            [ AST.PackageFunction emptyRange [ "internal" ] "sample"
                                            , AST.ExternalFunction emptyRange [ "some", "module" ] "sample"
                                            ]
................................................................................
                                [ { name = "test"
                                  , typeSignature =
                                        AssociatedFunctionSignature.UserProvided
                                            { input = [ NotStackRange <| InternalRef [ "internal" ] "Tipe" [] ]
                                            , output = [ NotStackRange <| LocalRef "Int" [] ]
                                            }
                                  , sourceLocationRange = Nothing
                                  , documentation = ""
                                  , aliases = Dict.empty
                                  , imports = Dict.empty
                                  , implementation =
                                        SoloImpl
                                            [ AST.Function emptyRange "drop"
                                            , AST.Integer emptyRange 1
                                            ]
................................................................................
                                [ { name = "test"
                                  , typeSignature =
                                        AssociatedFunctionSignature.UserProvided
                                            { input = [ NotStackRange <| ExternalRef [ "external" ] "Tipe" [] ]
                                            , output = [ NotStackRange <| LocalRef "Int" [] ]
                                            }
                                  , sourceLocationRange = Nothing
                                  , documentation = ""
                                  , aliases = Dict.empty
                                  , imports = Dict.empty
                                  , implementation =
                                        SoloImpl
                                            [ AST.Function emptyRange "drop"
                                            , AST.Integer emptyRange 1
                                            ]
................................................................................
                                [ { name = "test"
                                  , typeSignature =
                                        AssociatedFunctionSignature.UserProvided
                                            { input = [ NotStackRange <| ExternalRef [ "external" ] "Tipe" [] ]
                                            , output = [ NotStackRange <| LocalRef "Int" [] ]
                                            }
                                  , sourceLocationRange = Nothing
                                  , documentation = ""
                                  , aliases = Dict.empty
                                  , imports = Dict.empty
                                  , implementation =
                                        MultiImpl
                                            [ ( TypeMatch emptyRange (ExternalRef [ "external" ] "Tipe" []) [ ( "value", LiteralInt 1 ) ]
                                              , [ AST.Function emptyRange "drop"
                                                , AST.Integer emptyRange 1
................................................................................
                                [ { name = "test"
                                  , typeSignature =
                                        AssociatedFunctionSignature.UserProvided
                                            { input = [ NotStackRange <| InternalRef [ "internal" ] "Tipe" [] ]
                                            , output = [ NotStackRange <| LocalRef "Int" [] ]
                                            }
                                  , sourceLocationRange = Nothing
                                  , documentation = ""
                                  , aliases = Dict.empty
                                  , imports = Dict.empty
                                  , implementation =
                                        MultiImpl
                                            [ ( TypeMatch emptyRange (InternalRef [ "internal" ] "Tipe" []) [ ( "value", LiteralInt 1 ) ]
                                              , [ AST.Function emptyRange "drop"
                                                , AST.Integer emptyRange 1

Modified tests/Test/Parser/Util.elm from [69e6ba697c] to [c45a582fc9].

147
148
149
150
151
152
153

154
155
156
157
158
159
160
...
163
164
165
166
167
168
169

170
171
172
173
174
175
176
...
180
181
182
183
184
185
186

187
188
189
190
191
192
193
                    ">" ++ name
            , typeSignature =
                AssociatedFunctionSignature.Verified
                    { input = List.map (NotStackRange << Tuple.second) members
                    , output = [ selfType ]
                    }
            , sourceLocationRange = Nothing

            , aliases = Dict.empty
            , imports = Dict.empty
            , implementation = AST.SoloImpl [ AST.ConstructType name ]
            }

        setters =
            List.map settersHelper members
................................................................................
            { name = ">" ++ memberName
            , typeSignature =
                AssociatedFunctionSignature.Verified
                    { input = [ selfType, NotStackRange type_ ]
                    , output = [ selfType ]
                    }
            , sourceLocationRange = Nothing

            , aliases = Dict.empty
            , imports = Dict.empty
            , implementation =
                AST.SoloImpl [ AST.SetMember name memberName ]
            }

        getters =
................................................................................
            { name = memberName ++ ">"
            , typeSignature =
                AssociatedFunctionSignature.Verified
                    { input = [ selfType ]
                    , output = [ NotStackRange type_ ]
                    }
            , sourceLocationRange = Nothing

            , aliases = Dict.empty
            , imports = Dict.empty
            , implementation =
                AST.SoloImpl [ AST.GetMember name memberName ]
            }

        allFuncs =







>







 







>







 







>







147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
...
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
...
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
                    ">" ++ name
            , typeSignature =
                AssociatedFunctionSignature.Verified
                    { input = List.map (NotStackRange << Tuple.second) members
                    , output = [ selfType ]
                    }
            , sourceLocationRange = Nothing
            , documentation = ""
            , aliases = Dict.empty
            , imports = Dict.empty
            , implementation = AST.SoloImpl [ AST.ConstructType name ]
            }

        setters =
            List.map settersHelper members
................................................................................
            { name = ">" ++ memberName
            , typeSignature =
                AssociatedFunctionSignature.Verified
                    { input = [ selfType, NotStackRange type_ ]
                    , output = [ selfType ]
                    }
            , sourceLocationRange = Nothing
            , documentation = ""
            , aliases = Dict.empty
            , imports = Dict.empty
            , implementation =
                AST.SoloImpl [ AST.SetMember name memberName ]
            }

        getters =
................................................................................
            { name = memberName ++ ">"
            , typeSignature =
                AssociatedFunctionSignature.Verified
                    { input = [ selfType ]
                    , output = [ NotStackRange type_ ]
                    }
            , sourceLocationRange = Nothing
            , documentation = ""
            , aliases = Dict.empty
            , imports = Dict.empty
            , implementation =
                AST.SoloImpl [ AST.GetMember name memberName ]
            }

        allFuncs =