navi
Safe HaskellNone
LanguageGHC2021

Navi.Utils

Description

Provides utilities.

Since: 0.1

Synopsis

TOML

Decoding utils

getFieldOptArrayOf :: DecodeTOML a => Text -> Decoder [a] Source #

Decodes an optional list. This is morally

getFieldOptWith (getArrayOf tomlDecoder) :: Text -> Decoder (Maybe [a])

except we return an empty list when the key is missing rather than Nothing.

Since: 0.1

Specific decoders

commandDecoder :: Decoder Command Source #

TOML decoder for Command with field name "command".

Since: 0.1

urgencyLevelOptDecoder :: Decoder (Maybe UrgencyLevel) Source #

TOML decoder for optional UrgencyLevel with field name "urgency".

Since: 0.1

Misc

escapeDoubleQuotes :: Text -> Text Source #

Escape double quotes in strings.

whenJust :: Applicative f => Maybe a -> (a -> f ()) -> f () Source #

Since: 0.1