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
The main reason for redundant functions and annotations is my attempt to reduce compilation cost in cases where complex type level stuff is not needed but to still allow more complex constructions. This has to do with supporting sets of type level encodings that share the same "algorithm" and can reason on the type level about it (think "r-TIMESTAMP:%Y.%m.%d""r-TIMESTAMP" is the algorithm). Compilation is faster if algorithms are defined redundantly as a separate symbol avoiding overhead of TypeFamily computation that parses it out.
typed-encoding also needs to create a new fully declarative string manipulation boilerplate. All of this has a potential to spiral out of control.
Performance
It is not trivial to improve over something like decodeUtf8. Validating that a ByteString is a valid UTF8 is currently just using decodeUtf8'. Similarly it is hard to validate Base64 encoding faster than actually trying to decode it. Using lazy types seems to be better for validation.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Complexity
The main reason for redundant functions and annotations is my attempt to reduce compilation cost in cases where complex type level stuff is not needed but to still allow more complex constructions. This has to do with supporting sets of type level encodings that share the same "algorithm" and can reason on the type level about it (think
"r-TIMESTAMP:%Y.%m.%d"
"r-TIMESTAMP"
is the algorithm). Compilation is faster if algorithms are defined redundantly as a separate symbol avoiding overhead of TypeFamily computation that parses it out.typed-encoding also needs to create a new fully declarative string manipulation boilerplate. All of this has a potential to spiral out of control.
Performance
It is not trivial to improve over something like
decodeUtf8
. Validating that aByteString
is a validUTF8
is currently just usingdecodeUtf8'
. Similarly it is hard to validate Base64 encoding faster than actually trying to decode it. Using lazy types seems to be better for validation.Beta Was this translation helpful? Give feedback.
All reactions