úÎ!?Î=^*      !"#$%&'()(c) Zoltan Kelemen 2017  BSD-style kelemzol@elte.hu None ,-=?@AEHUVX LhtssetsjHelper heterogeneous list for comfortable HtsSet building (with append and fill) > let hs = fill ("a" :+ c7 :+ True :+ ()) > lookup (hs :: HtsCSet Show) == Just cn > use () to close the list > lookup (hs :: HtsCSet Show) == Just () -- is False! > let hs' = fill ("a" :+ cI :+ True :+ () :+ ()) > lookup (hs' :: HtsCSet Show) == Just () -- is Ok*htssets A proxy typehtssetsThe empty HtsCSethtssetsThe empty HtsCSet with proxyhtssetsA HtsCSet with an elementhtssets$A HtsCSet with an element with proxy htssetsOIs the HtsCSet is empty? > null empty == True > null (singleton "a") == False htssetsTThe number of elements in the HtsSet > size empty == 0 > size (singleton "a") == 1 htssets™The HtsCSet is contain a same type of element? > member (Proxy :: Proxy String) empty == False > member (Proxy :: Proxy String) (singleton "a") == True htssets2The HtsCSet is not contain a same type of element? htssetsÂInsert a new value in the HtsCSet. If the a elem is already present in the HtsCSet with type, the associated value is replaced with the supplied value > insert "a" $ insert (2 :: Int) $ insert c $ emptyhtssetsWLookup a value from in the HtsCSet > let hs = insert "a" $ insert (2 :: Int) $ insert c˜ $ empty > lookup hs == Just "a" > lookup hs == Just (2 :: Int) > but > lookup hs == Just 2 -- is False! Because the type of 2 is Num t => t not Inthtssets7Lookup a value from in the HtsCSet with a default valuehtssetsNUpdate a value in HtsCSet > let hs = insert "a" $ insert (2 :: Int) $ insert cB $ empty > let hs' = update (++"b") hs > lookup hs' == Just "ab"htssetscThe HtsCSet is contain a same type of element? > let hs = insert "a" $ insert (2 :: Int) $ insert c+ $ empty > existTypeOf "string" hs == Truehtssets9The HtsCSet is contain a same type of element? (by proxy)  55(c) Zoltan Kelemen 2017  BSD-style kelemzol@elte.hu SafeEUVX<¤htssetsjHelper heterogeneous list for comfortable HtsSet building (with append and fill) > let hs = fill ("a" :+ c% :+ True :+ ()) > lookup hs == Just c\ > use () to close the list > lookup hs == Just () -- is False! > let hs' = fill ("a" :+ c7 :+ True :+ () :+ ()) > lookup hs' == Just () -- is Ok+htssets A proxy typehtssetsThe empty HtsSethtssetsA HtsSet with an elementhtssetsNIs the HtsSet is empty? > null empty == True > null (singleton "a") == FalsehtssetsTThe number of elements in the HtsSet > size empty == 0 > size (singleton "a") == 1htssets˜The HtsSet is contain a same type of element? > member (Proxy :: Proxy String) empty == False > member (Proxy :: Proxy String) (singleton "a") == True htssets1The HtsSet is not contain a same type of element?!htssetsÀInsert a new value in the HtsSet. If the a elem is already present in the HtsSet with type, the associated value is replaced with the supplied value > insert "a" $ insert (2 :: Int) $ insert c $ empty"htssetsVLookup a value from in the HtsSet > let hs = insert "a" $ insert (2 :: Int) $ insert c˜ $ empty > lookup hs == Just "a" > lookup hs == Just (2 :: Int) > but > lookup hs == Just 2 -- is False! Because the type of 2 is Num t => t not Int#htssets6Lookup a value from in the HtsSet with a default value$htssetsMUpdate a value in HtsSet > let hs = insert "a" $ insert (2 :: Int) $ insert cB $ empty > let hs' = update (++"b") hs > lookup hs' == Just "ab"%htssetsbThe HtsSet is contain a same type of element? > let hs = insert "a" $ insert (2 :: Int) $ insert c+ $ empty > existTypeOf "string" hs == True&htssets8The HtsSet is contain a same type of element? (by proxy) !"#$%&' !"#$%&'55,         &htssets-0.1.0.0-369T38WTt1YGvi0i7TP7Lo Data.HtsCSet Data.HtsSetAppendappend:+HtsCSetemptyemptyP singleton singletonPnullsizemember notMemberinsertlookuplookupWithDefaultupdate existTypeOf existTypeOfPfill $fAppendc() $fAppendc:+HtsSet $fAppend() $fAppend:+P