X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=GHC%2FIO%2FEncoding%2FTypes.hs;h=caffa24815f0e8c255bcc413022420c16fc54a0c;hb=41e8fba828acbae1751628af50849f5352b27873;hp=bac4af2839ba37815fb2e5b49db764d6bc169f5b;hpb=8afc9fecd586d3c4f7ef9c69fb1686a79e5f441d;p=ghc-base.git diff --git a/GHC/IO/Encoding/Types.hs b/GHC/IO/Encoding/Types.hs index bac4af2..caffa24 100644 --- a/GHC/IO/Encoding/Types.hs +++ b/GHC/IO/Encoding/Types.hs @@ -1,4 +1,6 @@ -{-# OPTIONS_GHC -fno-implicit-prelude -funbox-strict-fields #-} +{-# LANGUAGE NoImplicitPrelude, ExistentialQuantification #-} +{-# OPTIONS_GHC -funbox-strict-fields #-} + ----------------------------------------------------------------------------- -- | -- Module : GHC.IO.Encoding.Types @@ -22,6 +24,7 @@ module GHC.IO.Encoding.Types ( import GHC.Base import GHC.Word +import GHC.Show -- import GHC.IO import GHC.IO.Buffer @@ -84,6 +87,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