newtype Plain = Plain ByteString deriving (Show, Eq) newtype Encrypted = Encrypted ByteString deriving (Show, Eq) encrypt :: Plain -> Encrypted encrypt m = ...