X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=GHC%2FIO%2FEncoding%2FTypes.hs;h=640ea8847d4ad66448cabbf9959c8b1d4920185a;hb=d0de62a16dc452a30d849a345344733327c98692;hp=9be6c98b1324a0a55c737804a5e171bc6b491589;hpb=207e64ee80ef749dbb46df0fa6a134b19d5a42a5;p=ghc-base.git diff --git a/GHC/IO/Encoding/Types.hs b/GHC/IO/Encoding/Types.hs index 9be6c98..640ea88 100644 --- a/GHC/IO/Encoding/Types.hs +++ b/GHC/IO/Encoding/Types.hs @@ -22,6 +22,7 @@ module GHC.IO.Encoding.Types ( import GHC.Base import GHC.Word +import GHC.Show -- import GHC.IO import GHC.IO.Buffer @@ -84,6 +85,13 @@ type TextEncoder state = BufferCodec CharBufElem Word8 state -- of bytes. The 'TextEncoding' for UTF-8 is 'utf8'. data TextEncoding = forall dstate estate . TextEncoding { + textEncodingName :: String, + -- ^ a string that can be passed to 'mkTextEncoding' to + -- create an equivalent 'TextEncoding'. mkTextDecoder :: IO (TextDecoder dstate), mkTextEncoder :: IO (TextEncoder estate) } + +instance Show TextEncoding where + -- | Returns the value of 'textEncodingName' + show te = textEncodingName te