module Servant.Server.Auth.Token.Common where
import qualified Data.Text as T
import qualified Data.ByteString.Lazy.Char8 as BSL
showb :: Show a => a -> BSL.ByteString
showb = BSL.pack . show
showt :: Show a => a -> T.Text
showt = T.pack . show
whenNothing :: Applicative m => Maybe a -> m () -> m ()
whenNothing Nothing m = m
whenNothing (Just _) _ = pure ()
whenJust :: Applicative m => Maybe a -> (a -> m ()) -> m ()
whenJust Nothing _ = pure ()
whenJust (Just x) m = m x
class ConvertableKey a where
fromKey :: Integral b => a -> b
toKey :: Integral b => b -> a