request for reviews for my first patch -- ticket 7401

Edward Z. Yang ezyang at MIT.EDU
Fri Aug 9 18:28:04 CEST 2013


Hello Omer,

It is almost certainly the case that the implementation of these
functions should not be the constant return True function.  Furthermore,
the implementation should probably be done using:

    http://ghc.haskell.org/trac/ghc/ticket/2431

Edward

Excerpts from Ömer Sinan Ağacan's message of Fri Aug 09 08:06:19 -0700 2013:
> Hi all,
> 
> I just started GHC development made a commit for ticket 7401:
> http://ghc.haskell.org/trac/ghc/ticket/7401
> 
> My patch is here:
> https://github.com/osa1/ghc/commit/3ec257ff48372de30df59cd8854ce28954c9db95
> 
> 
> `make test` succeeds. My test case for this patch is something like this:
> 
> 
>     data D deriving Eq
> 
>     main :: IO ()
>     main = print ((undefined :: D) == (undefined :: D))
> 
> 
> example:
> 
> 
> ➜  haskell  ./ghc/inplace/bin/ghc-stage2 --interactive derive.hs
> GHCi, version 7.7.20130806: http://www.haskell.org/ghc/  :? for help
> Loading package ghc-prim ... linking ... done.
> Loading package integer-gmp ... linking ... done.
> Loading package base ... linking ... done.
> [1 of 1] Compiling Main             ( derive.hs, interpreted )
> Ok, modules loaded: Main.
> ghci> main
> True
> it :: ()
> 
> 
> This behavior(returning True) is consistent with standalone deriving version:
> 
> 
>     ➜  haskell  cat derive_standalone.hs
>     {-# LANGUAGE StandaloneDeriving #-}
> 
>     data D
> 
>     deriving instance Eq D
> 
>     main :: IO ()
>     main = print ((undefined :: D) == (undefined :: D))
> 
>     ➜  haskell  ./ghc/inplace/bin/ghc-stage2 --interactive derive_standalone.hs
>     GHCi, version 7.7.20130806: http://www.haskell.org/ghc/  :? for help
>     Loading package ghc-prim ... linking ... done.
>     Loading package integer-gmp ... linking ... done.
>     Loading package base ... linking ... done.
>     [1 of 1] Compiling Main             ( derive_standalone.hs, interpreted )
>     Ok, modules loaded: Main.
>     ghci> main
>     True
>     it :: ()
>     ghci>
>     Leaving GHCi.
> 
> 
> 
> However, if you want (==) implementation in this case to be `error
> "Void (==)`, I think I can also do that by first fixing the code
> generated by StandaloneDeriving extension and then fixing my current
> patch.
> 
> 
> 
> Any comments and reviews would be appreciated!
> 
> 
> ---
> Ömer Sinan Ağacan
> http://osa1.net
> 




More information about the ghc-devs mailing list