You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have edn.AddTagFn and edn.AddTagStruct which makes it possible to convert any tagged EDN value into any untagged value.
edn.EncodeConvert would complement edn.AddTagFn, taking in a function of one argument that returns two arguments: The value to actually encode, and an error if something went wrong.
edn.EncodeAsTag would complement edn.AddTagStruct in the same fashion.
In this way, people can use other people's libraries without having to make wrapper types for every type they export. For example, attaching a definition for time.Time would look like this:
We have
edn.AddTagFn
andedn.AddTagStruct
which makes it possible to convert any tagged EDN value into any untagged value.edn.EncodeConvert
would complementedn.AddTagFn
, taking in a function of one argument that returns two arguments: The value to actually encode, and an error if something went wrong.edn.EncodeAsTag
would complementedn.AddTagStruct
in the same fashion.In this way, people can use other people's libraries without having to make wrapper types for every type they export. For example, attaching a definition for
time.Time
would look like this:The text was updated successfully, but these errors were encountered: