packages feed

derive-trie 0.2 → 0.2.1

raw patch · 2 files changed

+4/−3 lines, 2 files

Files

derive-trie.cabal view
@@ -1,5 +1,5 @@ Name:          derive-trie-Version:       0.2+Version:       0.2.1 Stability:     Provisional Synopsis:      Automatic derivation of Trie implementations. Description:   Automatic derivation of Trie implementations from user
src/Data/Derive/Trie.hs view
@@ -58,7 +58,6 @@ import qualified Data.IntMap import Data.Array - -- trie types for some primitive types like Int,Char, .. prim2trie :: [(Type,Type)] prim2trie = [(ConT ''Int,    ConT ''Data.IntMap.IntMap),@@ -432,6 +431,7 @@ -- replaces recursively every key type by the corresponding trie type, as -- specified in key2trie replaceKeyByTrie :: [(Type,Type)] -> Type -> Type+replaceKeyByTrie key2trie ListT = replaceKeyByTrie key2trie $ ConT ''[] replaceKeyByTrie key2trie (AppT t1 t2) =    AppT (replaceKeyByTrie key2trie t1) (replaceKeyByTrie key2trie t2) replaceKeyByTrie key2trie keyType =@@ -603,7 +603,7 @@     DataD _ _ _ cons _ -> return cons     NewtypeD _ _ _ con _ -> return [con]     TySynD name _ t    -> do-       let (ConT newname) = getOutermostTypeOfType t+       let ConT newname =  getOutermostTypeOfType t        tdec <- doReify knownDecs newname        getConstrsOfDataDec knownDecs tdec     _                 -> error "Error:getConstrsOfDataDec: not implemented!"@@ -620,6 +620,7 @@  getOutermostTypeOfType :: Type -> Type getOutermostTypeOfType (AppT t1 t2) = getOutermostTypeOfType t1+getOutermostTypeOfType ListT = ConT ''[] getOutermostTypeOfType t = t  -- returns the constructor for the empty trie