{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE AllowAmbiguousTypes #-}
module Data.TypedEncoding.Common.Class (
module Data.TypedEncoding.Common.Class
, module Data.TypedEncoding.Common.Class.Util
, module Data.TypedEncoding.Common.Class.Encode
, module Data.TypedEncoding.Common.Class.Decode
, module Data.TypedEncoding.Common.Class.Validate
, module Data.TypedEncoding.Common.Class.Superset
) where
import Data.TypedEncoding.Common.Class.Util
import Data.TypedEncoding.Common.Class.Encode
import Data.TypedEncoding.Common.Class.Decode
import Data.TypedEncoding.Common.Class.Validate
import Data.TypedEncoding.Common.Class.Superset
import Data.TypedEncoding.Common.Types (Enc(..) )
import Data.TypedEncoding.Combinators.Unsafe (withUnsafeCoerce)
import GHC.TypeLits
class (KnownSymbol nm, KnownSymbol ann) => ToEncString f nm ann a str where
toEncF :: a -> f (Enc '[nm] () str)
class (KnownSymbol nm, KnownSymbol ann) => FromEncString f nm ann a str where
fromEncF :: Enc '[nm] () str -> f a
class FlattenAs (y :: Symbol) (x :: Symbol) where
flattenAs :: Enc (x ': xs) c str -> Enc '[y] c str
flattenAs = withUnsafeCoerce id