Skip to content

Commit

Permalink
Link generatedFunctionsForTypes
Browse files Browse the repository at this point in the history
  • Loading branch information
Viir committed Aug 13, 2023
1 parent d85fff6 commit 13c2b56
Showing 1 changed file with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -865,6 +865,31 @@ buildJsonConverterFunctionsForMultipleRoots :
}
buildJsonConverterFunctionsForMultipleRoots typeAnnotationsBeforeDeduplicating choiceTypes =
let
generatedFunctionsForTypes =
generateFunctionsForMultipleTypes
{ generateFromTypeAnnotation =
buildJsonConverterFunctionsForTypeAnnotation
>> (\functionsForType ->
[ functionsForType.encodeFunction, functionsForType.decodeFunction ]
)
>> List.map (\function -> { functionName = function.name, functionText = function.text })
, generateFromChoiceType =
(\( choiceTypeName, choiceType ) ->
jsonConverterFunctionFromChoiceType
{ choiceTypeName = choiceTypeName
, encodeValueExpression = jsonEncodeParamName
, typeArgLocalName = "type_arg"
}
choiceType
)
>> (\functionsForType ->
[ functionsForType.encodeFunction, functionsForType.decodeFunction ]
)
>> List.map (\function -> { functionName = function.name, functionText = function.text })
}
typeAnnotationsBeforeDeduplicating
choiceTypes

modulesToImportForChoiceTypes =
choiceTypes
|> Dict.keys
Expand Down

0 comments on commit 13c2b56

Please sign in to comment.