Changes between Version 13 and Version 14 of ExplicitTypeApplication
 Timestamp:
 Sep 18, 2012 1:32:51 PM (4 years ago)
Legend:
 Unmodified
 Added
 Removed
 Modified

ExplicitTypeApplication
v13 v14 22 22 23 23 We typically want to use (a) when we are not interested in types, only kinds. 24 For instance, in the `Sing` familyof the24 For instance, consider the following type family, which is a variant of the 25 25 [https://github.com/ghc/packagesbase/blob/master/GHC/TypeLits.hs typelevel literals module]: 26 26 {{{ 27 data family Sing(k :: ☐)27 type family SingRep (k :: ☐) 28 28 29 newtype instance Sing Nat = SNatInteger30 newtype instance Sing Symbol = SSymString29 type instance SingRep Nat = Integer 30 type instance SingRep Symbol = String 31 31 }}} 32 32 … … 40 40 {{{ 41 41 class SingE (k :: ☐) where 42 type SingRep (k :: ☐) :: *43 42 fromSing :: Sing (k :: ☐) > SingRep (k :: ☐) 44 43 45 44 instance SingE Nat where 46 type SingRep Nat = Integer47 45 fromSing (SNat n) = n 48 46 49 47 instance SingE Symbol where 50 type SingRep Symbol = String51 48 fromSing (SSym s) = s 52 49 }}}