Skip to content

Commit

Permalink
Export parser
Browse files Browse the repository at this point in the history
It can be useful to parse BCP47 tags in the context of a larger parser,
such as parsing the HTTP Accept-Language Header, which is formatted as

    {language}[;q={weight}][,...]

Doing this on top of fromText is possible, but a bit annoying.

NOTE: I attempted to move this to a Data.BCP47.Parser, but the current
top-level module contains too many lower-level data definitions for that
to be possible without an import-cycle. To address that, we could move
most of Data.BCP47 to .Internal modules themselves, and leave Data.BCP47
as a re-export, higher-level interface for the most common usage. This
would be a Good Thing, IMO, but has been deferred for now.
  • Loading branch information
pbrisbin committed Jul 28, 2020
1 parent 0c522a8 commit 3fd3a05
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions bcp47/library/Data/BCP47.hs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ module Data.BCP47
, mkLanguage
, mkLocalized
, fromText
, parser
-- * Serialization
, toText
-- * Subtags
Expand Down

0 comments on commit 3fd3a05

Please sign in to comment.