ua-parser-0.7.3: A library for parsing User-Agent strings, official Haskell port of ua-parser

Safe HaskellNone
LanguageHaskell2010

Web.UAParser

Contents

Synopsis

Parsing browser (user agent)

parseUA :: ByteString -> Maybe UAResult Source

Parse a given User-Agent string

parseUALenient :: ByteString -> UAResult Source

Parser that, upon failure to match a pattern returns a result of family Other with all other fields blank. This is mainly for compatibility with the uap-core test suite

data UAResult Source

Results datatype for the parsed User-Agent

Constructors

UAResult 

Fields

uarFamily :: Text
 
uarV1 :: Maybe Text
 
uarV2 :: Maybe Text
 
uarV3 :: Maybe Text
 

uarVersion :: UAResult -> Text Source

Construct a browser version-string from UAResult

Parsing OS

parseOS :: ByteString -> Maybe OSResult Source

Parse OS from given User-Agent string

parseOSLenient :: ByteString -> OSResult Source

Parser that, upon failure to match a pattern returns a result of family Other with all other fields blank. This is mainly for compatibility with the uap-core test suite

data OSResult Source

Result type for parseOS

Constructors

OSResult 

Fields

osrFamily :: Text
 
osrV1 :: Maybe Text
 
osrV2 :: Maybe Text
 
osrV3 :: Maybe Text
 
osrV4 :: Maybe Text
 

osrVersion :: OSResult -> Text Source

Construct a version string from OSResult

Parsing Dev

parseDevLenient :: ByteString -> DevResult Source

Parser that, upon failure to match a pattern returns a result of family Other with all other fields blank. This is mainly for compatibility with the uap-core test suite