{-# LINE 1 "src/Foreign/R/Encoding.hsc" #-}
-- | Character encodings.



module Foreign.R.Encoding where

-- | Content encoding.
data CEType
  = CE_Native
  | CE_UTF8
  | CE_Latin1
  | CE_Bytes
  | CE_Symbol
  | CE_Any
  deriving (CEType -> CEType -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CEType -> CEType -> Bool
$c/= :: CEType -> CEType -> Bool
== :: CEType -> CEType -> Bool
$c== :: CEType -> CEType -> Bool
Eq, Int -> CEType -> ShowS
[CEType] -> ShowS
CEType -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CEType] -> ShowS
$cshowList :: [CEType] -> ShowS
show :: CEType -> String
$cshow :: CEType -> String
showsPrec :: Int -> CEType -> ShowS
$cshowsPrec :: Int -> CEType -> ShowS
Show)

instance Enum CEType where
  fromEnum :: CEType -> Int
fromEnum CEType
CE_Native = Int
0
{-# LINE 19 "src/Foreign/R/Encoding.hsc" #-}
  fromEnum CE_UTF8   = 1
{-# LINE 20 "src/Foreign/R/Encoding.hsc" #-}
  fromEnum CE_Latin1 = 2
{-# LINE 21 "src/Foreign/R/Encoding.hsc" #-}
  fromEnum CE_Bytes  = 3
{-# LINE 22 "src/Foreign/R/Encoding.hsc" #-}
  fromEnum CE_Symbol = 5
{-# LINE 23 "src/Foreign/R/Encoding.hsc" #-}
  fromEnum CE_Any    = 99
{-# LINE 24 "src/Foreign/R/Encoding.hsc" #-}
  toEnum i = case i of
    (0) -> CE_Native
{-# LINE 26 "src/Foreign/R/Encoding.hsc" #-}
    (1)   -> CE_UTF8
{-# LINE 27 "src/Foreign/R/Encoding.hsc" #-}
    (2) -> CE_Latin1
{-# LINE 28 "src/Foreign/R/Encoding.hsc" #-}
    (3)  -> CE_Bytes
{-# LINE 29 "src/Foreign/R/Encoding.hsc" #-}
    (5) -> CE_Symbol
{-# LINE 30 "src/Foreign/R/Encoding.hsc" #-}
    (99)    -> CE_Any
{-# LINE 31 "src/Foreign/R/Encoding.hsc" #-}
    _ -> error "CEType.fromEnum: unknown tag"