Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't enforce compatibility with base #128

Open
adithyaov opened this issue Jun 17, 2024 · 1 comment
Open

Don't enforce compatibility with base #128

adithyaov opened this issue Jun 17, 2024 · 1 comment

Comments

@adithyaov
Copy link
Member

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)
@adithyaov adithyaov changed the title **Don't enforce compatibility** with base Don't enforce compatibility with base Jun 17, 2024
@wismill
Copy link
Collaborator

wismill commented Jul 12, 2024

Related: haskell/core-libraries-committee#278

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants