idn-0.1.2.0: Pure Haskell IDN and Punycode implementation
Safe HaskellNone
LanguageHaskell2010

Data.Text.IDN.Internal.Unicode

Description

Internal Unicode property lookups for IDN validation.

This module provides Unicode property lookups used internally for IDN validation. For public API, see IDN.

Implementation Note: IntMap/IntSet vs CharSet

This module uses IntMap and IntSet from containers rather than CharSet from the charset package. Benchmarking showed that:

  • Map lookups (codePointStatus, bidiClass, scriptOf, lookupContextRule) are 2-23% slower with CharSet, as it provides no benefit for map operations
  • Set membership tests (isCombiningMark, isVirama) show mixed results:
  • CharSet is 36% faster for negative lookups (non-combining chars)
  • CharSet is 2-6% slower for positive lookups and mixed workloads
  • Overall: IntMap/IntSet is faster for our workload which is dominated by map lookups rather than pure set membership tests
Synopsis

Property Lookup Functions

Unicode Normalization