
#9819: Create typesafe method of obtaining dictionary types from class definitions, and constraint objects from dictionary types -------------------------------------+------------------------------------- Reporter: | Owner: spacekitteh | Status: new Type: feature | Milestone: request | Version: Priority: normal | Keywords: Component: Compiler | Architecture: Unknown/Multiple Resolution: | Difficulty: Moderate (less Operating System: | than a day) Unknown/Multiple | Blocked By: Type of failure: | Related Tickets: None/Unknown | Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by spacekitteh): "I'm sorry, but I don't understand your request. The dictionary for IntLike would look something like this: data IntLikeDict a = MkIntLikeDict { fromInt :: Int -> a ; toInt :: a -> Int } There isn't an actual number stored anywhere. And, in fact, my example has made things more complicated than they really are. The dictionary type within GHC is IntLike -- there's no separate dictionary type." Yeah, I know, I just thought it would be obvious that I meant like, prependending the from/toInts with a lambda involving the first argument. Does the Dict method grant you access to the fromInt/toInt methods for each type? I.e. can you obtain, say, an IntLikeDict [Char] containing the functions? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9819#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler