<commit_before>{-# LANGUAGE DataKinds #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE ConstraintKinds #-}

module Ivory.Language.Proxy where

#if __GLASGOW_HASKELL__ >= 781
import GHC.TypeLits (natVal,symbolVal,Symbol,Nat,KnownNat,KnownSymbol)
#else
import GHC.TypeLits (Sing,fromSing,Symbol,Nat)
#endif

data Proxy (a :: k) = Proxy

-- | Type proxies for * types.
type SProxy a = Proxy (a :: *)

--------------------------------------------------------------------------------
#if __GLASGOW_HASKELL__ >= 781

type ANat    n = (KnownNat n)
type NatType n = Proxy n
aNat :: KnownNat n => Proxy n
aNat = Proxy

type ASymbol    s = (KnownSymbol s)
type SymbolType s = Proxy s
aSymbol :: KnownSymbol s => Proxy s
aSymbol = Proxy

-- | The string associated with a type-symbol.
fromTypeSym :: KnownSymbol sym => proxy (sym :: Symbol) -> String
fromTypeSym  = symbolVal
<commit_msg>Proxy: import all TypeNat identifiers.<commit_after>{-# LANGUAGE DataKinds #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE ConstraintKinds #-}

module Ivory.Language.Proxy where

#if __GLASGOW_HASKELL__ >= 781
import GHC.TypeLits (natVal, symbolVal, Symbol, Nat, KnownNat, KnownSymbol)
#else
import GHC.TypeLits (Sing, SingI, sing, fromSing, Symbol, Nat)
#endif

data Proxy (a :: k) = Proxy

-- | Type proxies for * types.
type SProxy a = Proxy (a :: *)

--------------------------------------------------------------------------------
#if __GLASGOW_HASKELL__ >= 781

type ANat    n = (KnownNat n)
type NatType n = Proxy n
aNat :: KnownNat n => Proxy n
aNat = Proxy

type ASymbol    s = (KnownSymbol s)
type SymbolType s = Proxy s
aSymbol :: KnownSymbol s => Proxy s
aSymbol = Proxy

-- | The string associated with a type-symbol.
fromTypeSym :: KnownSymbol sym => proxy (sym :: Symbol) -> String
fromTypeSym  = symbolVal

{'fraction_non_alphanumeric': 0.19936708860759494, 'fraction_numerical': 0.006329113924050633, 'mean_word_length': 2.7490118577075098, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3377306', 'n_tokens_mistral': 690, 'n_tokens_neox': 651, 'n_words': 196}