packages feed

tilia-0.2.0.0: corpora/vendored/pragma/declaration/warning-on-an-instance-across-lines-out'.hs

{-# LANGUAGE DerivingVia #-}

module Vault.Token where

newtype Token = Token String

{-# WARNING expire "A token expires on its own." #-}
expire :: Token -> Token
expire = id

instance
    {-# WARNING "Showing a token prints it." #-}
    Show Token
    where
    show (Token t) = t

instance
    {-# WARNING "Comparing tokens takes time." #-}
    Eq Token
    where
    Token a == Token b = a == b

deriving instance {-# WARNING "The order says nothing." #-} Ord Token

newtype Stamp = Stamp Int

deriving instance
    {-# WARNING "Stamps from two vaults do not compare." #-}
    Eq Stamp

deriving via
    Int
    instance
        {-# WARNING "Stamps from two vaults do not order." #-}
        Ord Stamp