#7066: isInstance does not work for compound types ---------------------------------+------------------------------------------ Reporter: edsko | Owner: simonpj Type: bug | Status: new Priority: normal | Milestone: Component: Template Haskell | Version: 7.4.2 Keywords: | Os: Unknown/Multiple Architecture: Unknown/Multiple | Failure: None/Unknown Difficulty: Unknown | Testcase: Blockedby: | Blocking: Related: | ---------------------------------+------------------------------------------
Comment(by edsko): Oh, I'm sorry. I would expect {{{ isInstance clss typs }}} to return True if and only if I can safely generate code (in my Template Haskell code) that relies on 'typs' being an instance of 'clss'. In the example above, I can ''not'' safely generate code that relies on a Show instance for (Int, A) because there is no Show instance for A. However, I ''can'' safely generate code that relies on a Show instance for (Int, Bool), say. Context: In Cloud Haskell when you call 'remotable' on a monomorphic function f :: T1 -> T2, I automatically generate a top-level definition {{{ f__sdict :: Static (SerializableDict T1) }}} but if T1 is not in fact serializable then this will subsequently cause a type error. So I would like to check (using isInstance) if T1 is an instance of Serializable before generating this code. -- Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7066#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler _______________________________________________ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs