Fully implement Decoding in EnvDecoding

This commit is contained in:
Ayaz Hafiz 2023-03-22 17:18:23 -05:00
parent f9f90a3684
commit 825ed1c8b3
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58

View file

@ -19,6 +19,7 @@ EnvFormat := {} has [
string: envString, string: envString,
list: envList, list: envList,
record: envRecord, record: envRecord,
tuple: envTuple,
}, },
] ]
@ -93,3 +94,10 @@ envList = \decodeElem -> Decode.custom \bytes, @EnvFormat {} ->
envRecord : _, (_, _ -> [Keep (Decoder _ _), Skip]), (_ -> _) -> Decoder _ _ envRecord : _, (_, _ -> [Keep (Decoder _ _), Skip]), (_ -> _) -> Decoder _ _
envRecord = \_initialState, _stepField, _finalizer -> Decode.custom \bytes, @EnvFormat {} -> envRecord = \_initialState, _stepField, _finalizer -> Decode.custom \bytes, @EnvFormat {} ->
{ result: Err TooShort, rest: bytes } { result: Err TooShort, rest: bytes }
# TODO: we must currently annotate the arrows here so that the lambda sets are
# exercised, and the solver can find an ambient lambda set for the
# specialization.
envTuple : _, (_, _ -> [Next (Decoder _ _), TooLong]), (_ -> _) -> Decoder _ _
envTuple = \_initialState, _stepElem, _finalizer -> Decode.custom \bytes, @EnvFormat {} ->
{ result: Err TooShort, rest: bytes }