bcp47: Language tags as specified by BCP 47

[ data, data-structures, library, mit ] [ Propose Tags ]

Language tags for use in cases where it is desirable to indicate the language used in an information object.

- https://tools.ietf.org/html/bcp47

This package exposes a language tag data type BCP47 and a Trie data structure for collecting and querying information that varies based on language tag.

import Data.BCP47 (en, enGB, sw)
import Data.BCP47.Trie (Trie, fromList, lookup)

color :: Trie Text
color = fromList [(en, "color"), (sw, "rangi")]

main = do
  print $ match en color -- Just "color"
  print $ match enGB color -- Nothing
  print $ lookup enGB color -- Just "color"

[Skip to Readme]

Modules

[Last Documentation]

  • Data
    • Data.BCP47
      • Internal
        • Data.BCP47.Internal.Arbitrary
        • Data.BCP47.Internal.Extension
        • Data.BCP47.Internal.Language
        • Data.BCP47.Internal.LanguageExtension
        • Data.BCP47.Internal.Parser
        • Data.BCP47.Internal.PrivateUse
        • Data.BCP47.Internal.Region
        • Data.BCP47.Internal.Script
        • Data.BCP47.Internal.Subtags
        • Data.BCP47.Internal.Variant
      • Data.BCP47.Trie
        • Data.BCP47.Trie.Internal

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.1.0.0, 0.2.0.0, 0.2.0.1, 0.2.0.2, 0.2.0.3, 0.2.0.4, 0.2.0.5, 0.2.0.6
Change log ChangeLog.md
Dependencies aeson (>=1.4.7.1 && <1.5), base (>=4.7 && <5), containers (>=0.6.2.1 && <0.7), country (>=0.2.1 && <0.3), generic-arbitrary (>=0.1.0 && <0.2), iso639 (>=0.1.0.3 && <0.2), megaparsec (>=8.0.0 && <8.1), QuickCheck (>=2.13.2 && <2.14), text (>=1.2.4.0 && <1.3) [details]
License MIT
Copyright 2019 Freckle Education
Author Evan Rutledge Borden
Maintainer engineering@freckle.com
Category Data, Data Structures
Home page https://github.com/freckle/bcp47#readme
Bug tracker https://github.com/freckle/bcp47/issues
Source repo head: git clone https://github.com/freckle/bcp47
Uploaded by PatrickBrisbin at 2020-12-09T14:06:00Z
Distributions LTSHaskell:0.2.0.6, NixOS:0.2.0.6
Reverse Dependencies 2 direct, 0 indirect [details]
Downloads 1837 total (27 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
All reported builds failed as of 2020-12-09 [all 3 reports]

Readme for bcp47-0.2.0.0

[back to package description]

BCP-47

CircleCI

Language tags for use in cases where it is desirable to indicate the language used in an information object.