A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://hackage.haskell.org/packages/archive/base/4.6.0.0/doc/html/src/GHC-IO-Encoding-Types.html below:

GHC/IO/Encoding/Types.hs



















module GHC.IO.Encoding.Types (
    BufferCodec(..),
    TextEncoding(..),
    TextEncoder, TextDecoder,
    EncodeBuffer, DecodeBuffer,
    CodingProgress(..)
  ) where

import GHC.Base
import GHC.Word
import GHC.Show

import GHC.IO.Buffer




data BufferCodec from to state = BufferCodec {
  encode :: Buffer from -> Buffer to -> IO (CodingProgress, Buffer from, Buffer to),
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
  
  recover :: Buffer from -> Buffer to -> IO (Buffer from, Buffer to),
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
  
  close  :: IO (),
   
   
   

  getState :: IO state,
   
   
   
   
   
   
   
   
   
   
   

  setState :: state -> IO ()
   
   
 }

type DecodeBuffer = Buffer Word8 -> Buffer Char
                  -> IO (CodingProgress, Buffer Word8, Buffer Char)

type EncodeBuffer = Buffer Char -> Buffer Word8
                  -> IO (CodingProgress, Buffer Char, Buffer Word8)

type TextDecoder state = BufferCodec Word8 CharBufElem state
type TextEncoder state = BufferCodec CharBufElem Word8 state






data TextEncoding
  = forall dstate estate . TextEncoding  {
        textEncodingName :: String,
                   
                   
        mkTextDecoder :: IO (TextDecoder dstate),
                   
                   
        mkTextEncoder :: IO (TextEncoder estate)
                   
                   
  }

instance Show TextEncoding where
  
  show te = textEncodingName te

data CodingProgress = InputUnderflow  
                                      
                    | OutputUnderflow 
                    | InvalidSequence 
                                      
                                      
                    deriving (Eq, Show)


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4