Changes between Version 13 and Version 14 of ExplicitTypeApplication


Ignore:
Timestamp:
Sep 18, 2012 1:32:51 PM (3 years ago)
Author:
diatchki
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ExplicitTypeApplication

    v13 v14  
    2222
    2323We typically want to use (a) when we are not interested in types, only kinds.
    24 For instance, in the `Sing` family of the
     24For instance, consider the following type family, which is a variant of the
    2525[https://github.com/ghc/packages-base/blob/master/GHC/TypeLits.hs type-level literals module]:
    2626{{{
    27 data family Sing (k :: ☐)
     27type family SingRep (k :: ☐)
    2828
    29 newtype instance Sing Nat    = SNat Integer
    30 newtype instance Sing Symbol = SSym String
     29type instance SingRep Nat    = Integer
     30type instance SingRep Symbol = String
    3131}}}
    3232
     
    4040{{{
    4141class SingE (k :: ☐) where
    42   type SingRep (k :: ☐) :: *
    4342  fromSing :: Sing (k :: ☐) -> SingRep (k :: ☐)
    4443
    4544instance SingE Nat where
    46   type SingRep Nat = Integer
    4745  fromSing (SNat n) = n
    4846
    4947instance SingE Symbol where
    50   type SingRep Symbol = String
    5148  fromSing (SSym s) = s
    5249}}}