[ 
https://issues.apache.org/jira/browse/THRIFT-1921?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13625832#comment-13625832
 ] 

Rodrigo Setti edited comment on THRIFT-1921 at 4/8/13 9:22 PM:
---------------------------------------------------------------

Also, there is two issues left to be fixed:

1) Some higher level structures are not working because they're not Hashable. 
The following code fix that - but it should live somewhere else (probably 
Data.Hashable or Thrift):

{noformat}
instance Hashable a => Hashable (Vector.Vector a) where                         
    
    hashWithSalt s v = hashWithSalt s $ Vector.toList v                         
    
                                                                                
    
instance (Hashable a, Hashable b) => Hashable (Map.HashMap a b) where           
    
    hashWithSalt s v = hashWithSalt s $ Map.toList v          
                                                                                
    
instance Hashable a => Hashable (Set.HashSet a) where                           
    
    hashWithSalt s v = hashWithSalt s $ Set.toList v
{noformat}


2) includes are not working if mapped to "import qualified". I'm wondering 
whether we should use a qualified name everywhere or don't import qualified.


                
      was (Author: rodrigosetti):
    Also, some higher level structures are not working because they're not 
Hashable. The following code fix that - but it should live somewhere else 
(probably Data.Hashable or Thrift):

{noformat}
instance Hashable a => Hashable (Vector.Vector a) where                         
    
    hashWithSalt s v = hashWithSalt s $ Vector.toList v                         
    
                                                                                
    
instance (Hashable a, Hashable b) => Hashable (Map.HashMap a b) where           
    
    hashWithSalt s v = hashWithSalt s $ Map.toList v          
                                                                                
    
instance Hashable a => Hashable (Set.HashSet a) where                           
    
    hashWithSalt s v = hashWithSalt s $ Set.toList v
{noformat}

                  
> Make Haskell work with new GHC
> ------------------------------
>
>                 Key: THRIFT-1921
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1921
>             Project: Thrift
>          Issue Type: Bug
>          Components: Haskell - Compiler
>            Reporter: Rodrigo Setti
>         Attachments: thrift-hs-fix.patch
>
>
> The Thrift Haskell compiler is generating code that's not working with the 
> current version of Haskell's GHC compiler, and the current Haskell library.
> The fix is simple, in two places:
>  * Remove the import {{import Thrift.Types ()}} because this moduled does not 
> exist.
>  * Map Thrift type {{string}} to Haskell's {{String}} (instead of {{Text}}) - 
> that's what the Haskell Thrift library accepts.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to