Hi all,

I have below instances:

       instance PageViewState DiredViewState where
       instance PageViewState StringViewState where

I can use Language.Haskell.Exts.Parser scan above instances got list:

       typeList :: [Type]
       typeList = [TyCon (UnQual (Ident "DiredViewState")),TyCon (UnQual (Ident 
"DiredViewState"))]

So question is how to use Template Haskell and above `typeList` build
below `Map` at compile-time? 
       
tagmap = M.fromList [(typeIdOf StringViewState, Exists (Dict :: 
PageViewStateDict StringViewState))
                    ,(typeIdOf DiredViewState, Exists (Dict :: 
PageViewStateDict DiredViewState))]
                    
Thanks!

  -- Andy
                    
                    

                    

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to