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
Being compatible with base is NOT required. This is not the responsibility of
the library. Enforcing compatibility also gives an incorrect idea on the
dependency graph. We use functions in base, not the unicode primitives. Hence
it would be incorrect to constraint base depending on the unicode version.
The best case solution is to let base depend unicode-data and
friends. Although, this is not a straightforward task.
The compatibility with the base primitives is a domain specific problem. The
overhead of the check should be pushed to the user. The user may choose to force
compatibility depending on how unicode is being used. The following snippet
checks for compatibility and fails accordingly:
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE QuasiQuotes #-}
import qualified Unicode.Char as UnicodeData (unicodeVersion)
import qualified GHC.Unicode as Base (unicodeVersion)
unicodeCompatibility :: ()
unicodeCompatibility =
$(if Base.unicodeVersion == UnicodeData.unicodeVersion
then [|()|]
else error $ "Incompatible unicode versions: "
++ "base: " ++ show Base.unicodeVersion ++ " "
++ "unicode-data: " ++ show UnicodeData.unicodeVersion)
The text was updated successfully, but these errors were encountered:
adithyaov
changed the title
**Don't enforce compatibility** with base
Don't enforce compatibility with baseJun 17, 2024
Being compatible with base is NOT required. This is not the responsibility of
the library. Enforcing compatibility also gives an incorrect idea on the
dependency graph. We use functions in
base
, not the unicode primitives. Henceit would be incorrect to constraint
base
depending on the unicode version.The best case solution is to let
base
dependunicode-data
andfriends. Although, this is not a straightforward task.
The compatibility with the
base
primitives is a domain specific problem. Theoverhead of the check should be pushed to the user. The user may choose to force
compatibility depending on how unicode is being used. The following snippet
checks for compatibility and fails accordingly:
The text was updated successfully, but these errors were encountered: