module Prelude
( module Exports
, parseInt
, headMay
) where
import Control.Monad.Trans.Resource as Exports (ResourceT,
liftResourceT,
runResourceT)
import Network.HTTP.Types as Exports
import Network.Wai as Exports
import Relude as Exports hiding (get, put)
import qualified Data.Text.Read as TR
import UnliftIO.Exception as Exports (throwIO)
import Formatting as Exports (format, sformat, (%))
import Formatting.ShortFormatters as Exports (d, sh, st, t)
parseInt :: Integral a => Text -> Maybe a
parseInt t' = either (const Nothing) Just $ fmap fst $ TR.decimal t'
headMay :: [a] -> Maybe a
headMay [] = Nothing
headMay (a:_) = Just a