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
withCompression'::MonadSnapm=>SetByteString--^ set of compressible MIME types->ma--^ the web handler to run->m()
The use of Set seems to be too inflexible to me, e.g. if you wanted to compress all mime-types matching text/*, you'd have to enumerate them all; or if you wanted to use a HashSet instead of Set. Also, in some cases you might want to compress the data only if a certain size threshold is exceeded. Thus, I'd suggest using a predicate function with the signature :: ByteString -> Int64 -> Bool instead of a value of type Set ByteString.
PS: is there a reason, that the monadic value of m a is discarded, and is transformed into a m () action?
The text was updated successfully, but these errors were encountered:
The current signature reads:
The use of
Set
seems to be too inflexible to me, e.g. if you wanted to compress all mime-types matchingtext/*
, you'd have to enumerate them all; or if you wanted to use aHashSet
instead ofSet
. Also, in some cases you might want to compress the data only if a certain size threshold is exceeded. Thus, I'd suggest using a predicate function with the signature:: ByteString -> Int64 -> Bool
instead of a value of typeSet ByteString
.PS: is there a reason, that the monadic value of
m a
is discarded, and is transformed into am ()
action?The text was updated successfully, but these errors were encountered: