Changes between Version 43 and Version 44 of TypeNats/Basics


Ignore:
Timestamp:
Oct 16, 2012 5:31:51 AM (3 years ago)
Author:
diatchki
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TypeNats/Basics

    v43 v44  
    8282is the definition of the `Show` instance:
    8383{{{
    84 instance Show (SingRep a) => Show (Sing a) where
     84instance (SingE (KindOf a, Show (Demote a)) => Show (Sing a) where
    8585  showsPrec p = showsPrec p . fromSing
    8686}}}
     
    9393withSing f = f sing
    9494
    95 singThat :: SingI a => (SingRep a -> Bool) -> Maybe (Sing a)
     95singThat :: SingRep a => (Demote a -> Bool) -> Maybe (Sing a)
    9696singThat p = withSing $ \x -> if p (fromSing x) then Just x else Nothing
    9797}}}
     
    120120
    121121{{{
    122 instance (SingI a, Read (SingRep a), Eq (SingRep a)) => Read (Sing a) where
     122instance (SingRep a, Read (Demote a), Eq (Demote a)) => Read (Sing a) where
    123123  readsPrec p cs = do (x,ys) <- readsPrec p cs
    124124                      case singThat (== x) of