| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Web.UAParser
Synopsis
- parseUA :: ByteString -> Maybe UAResult
- parseUALenient :: ByteString -> UAResult
- data UAResult = UAResult {}
- uarVersion :: UAResult -> Text
- parseOS :: ByteString -> Maybe OSResult
- parseOSLenient :: ByteString -> OSResult
- data OSResult = OSResult {}
- osrVersion :: OSResult -> Text
- parseDev :: ByteString -> Maybe DevResult
- parseDevLenient :: ByteString -> DevResult
- data DevResult = DevResult {}
Parsing browser (user agent)
parseUA :: ByteString -> Maybe UAResult #
Parse a given User-Agent string
parseUALenient :: ByteString -> UAResult #
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
Results datatype for the parsed User-Agent
Constructors
| UAResult | |
Instances
| Eq UAResult # | |
| Data UAResult # | |
Defined in Web.UAParser Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> UAResult -> c UAResult # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c UAResult # toConstr :: UAResult -> Constr # dataTypeOf :: UAResult -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c UAResult) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c UAResult) # gmapT :: (forall b. Data b => b -> b) -> UAResult -> UAResult # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> UAResult -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> UAResult -> r # gmapQ :: (forall d. Data d => d -> u) -> UAResult -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> UAResult -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> UAResult -> m UAResult # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> UAResult -> m UAResult # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> UAResult -> m UAResult # | |
| Read UAResult # | |
| Show UAResult # | |
| Generic UAResult # | |
| Default UAResult # | |
Defined in Web.UAParser | |
| type Rep UAResult # | |
Defined in Web.UAParser type Rep UAResult = D1 (MetaData "UAResult" "Web.UAParser" "ua-parser-0.7.5.1-1WiuhVpDgIx8IDiWxBKNif" False) (C1 (MetaCons "UAResult" PrefixI True) ((S1 (MetaSel (Just "uarFamily") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text) :*: S1 (MetaSel (Just "uarV1") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Text))) :*: (S1 (MetaSel (Just "uarV2") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Text)) :*: S1 (MetaSel (Just "uarV3") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Text))))) | |
uarVersion :: UAResult -> Text #
Construct a browser version-string from UAResult
Parsing OS
parseOS :: ByteString -> Maybe OSResult #
Parse OS from given User-Agent string
parseOSLenient :: ByteString -> OSResult #
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
Result type for parseOS
Constructors
| OSResult | |
Instances
| Eq OSResult # | |
| Data OSResult # | |
Defined in Web.UAParser Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> OSResult -> c OSResult # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c OSResult # toConstr :: OSResult -> Constr # dataTypeOf :: OSResult -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c OSResult) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c OSResult) # gmapT :: (forall b. Data b => b -> b) -> OSResult -> OSResult # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> OSResult -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> OSResult -> r # gmapQ :: (forall d. Data d => d -> u) -> OSResult -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> OSResult -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> OSResult -> m OSResult # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> OSResult -> m OSResult # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> OSResult -> m OSResult # | |
| Read OSResult # | |
| Show OSResult # | |
| Generic OSResult # | |
| Default OSResult # | |
Defined in Web.UAParser | |
| type Rep OSResult # | |
Defined in Web.UAParser type Rep OSResult = D1 (MetaData "OSResult" "Web.UAParser" "ua-parser-0.7.5.1-1WiuhVpDgIx8IDiWxBKNif" False) (C1 (MetaCons "OSResult" PrefixI True) ((S1 (MetaSel (Just "osrFamily") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text) :*: S1 (MetaSel (Just "osrV1") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Text))) :*: (S1 (MetaSel (Just "osrV2") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Text)) :*: (S1 (MetaSel (Just "osrV3") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Text)) :*: S1 (MetaSel (Just "osrV4") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Text)))))) | |
osrVersion :: OSResult -> Text #
Construct a version string from OSResult
Parsing Dev
parseDev :: ByteString -> Maybe DevResult #
parseDevLenient :: ByteString -> DevResult #
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
Result type for parseDev
Instances
| Eq DevResult # | |
| Data DevResult # | |
Defined in Web.UAParser Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> DevResult -> c DevResult # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c DevResult # toConstr :: DevResult -> Constr # dataTypeOf :: DevResult -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c DevResult) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c DevResult) # gmapT :: (forall b. Data b => b -> b) -> DevResult -> DevResult # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> DevResult -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> DevResult -> r # gmapQ :: (forall d. Data d => d -> u) -> DevResult -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> DevResult -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> DevResult -> m DevResult # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> DevResult -> m DevResult # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> DevResult -> m DevResult # | |
| Read DevResult # | |
| Show DevResult # | |
| Generic DevResult # | |
| Default DevResult # | |
Defined in Web.UAParser | |
| type Rep DevResult # | |
Defined in Web.UAParser type Rep DevResult = D1 (MetaData "DevResult" "Web.UAParser" "ua-parser-0.7.5.1-1WiuhVpDgIx8IDiWxBKNif" False) (C1 (MetaCons "DevResult" PrefixI True) (S1 (MetaSel (Just "drFamily") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text) :*: (S1 (MetaSel (Just "drBrand") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Text)) :*: S1 (MetaSel (Just "drModel") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Text))))) | |