{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE TypeInType #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE GADTs #-}
-- type SomeSing :: * -> *
data SomeSing k where
SomeSing :: Sing (a :: k) -> SomeSing k
data family Sing (a :: k)
class SingKind k where
fromSing :: Sing (a :: k) -> k
toSing :: k -> SomeSing k
-----
data instance Sing
(a
:: Bool) where STrue :: Sing True
SFalse :: Sing False
instance SingKind
Bool where fromSing s = case s of
STrue -> True
SFalse -> False
toSing b = case b of
True -> SomeSing STrue
False -> SomeSing SFalse
ey0jIExBTkdVQUdFIFBvbHlLaW5kcyAgIy19CnstIyBMQU5HVUFHRSBUeXBlSW5UeXBlICMtfQp7LSMgTEFOR1VBR0UgVHlwZUZhbWlsaWVzICMtfQp7LSMgTEFOR1VBR0UgR0FEVHMgIy19CgoKbWFpbiA9IHByaW50ICJIZWxsbyIKCi0tIHR5cGUgU29tZVNpbmcgOjogKiAtPiAqCmRhdGEgU29tZVNpbmcgayB3aGVyZSAKICAgIFNvbWVTaW5nIDo6ICBTaW5nIChhIDo6IGspIC0+IFNvbWVTaW5nIGsKCmRhdGEgZmFtaWx5IFNpbmcgKGEgOjogaykKCmNsYXNzIFNpbmdLaW5kIGsgd2hlcmUKICBmcm9tU2luZyA6OiBTaW5nIChhIDo6IGspIC0+IGsKICB0b1NpbmcgICA6OiBrIC0+IFNvbWVTaW5nIGsKCi0tLS0tCgpkYXRhIGluc3RhbmNlIFNpbmcgKGEgOjogQm9vbCkgd2hlcmUgCiAgIFNUcnVlICA6OiBTaW5nIFRydWUKICAgU0ZhbHNlIDo6IFNpbmcgRmFsc2UKCmluc3RhbmNlIFNpbmdLaW5kIEJvb2wgd2hlcmUKICBmcm9tU2luZyBzID0gY2FzZSBzIG9mCiAgICBTVHJ1ZSAgLT4gVHJ1ZQogICAgU0ZhbHNlIC0+IEZhbHNlCgogIHRvU2luZyBiID0gY2FzZSBiIG9mCiAgICBUcnVlICAtPiBTb21lU2luZyBTVHJ1ZQogICAgRmFsc2UgLT4gU29tZVNpbmcgU0ZhbHNlCiAgICAK