[Haskell-cafe] How to implement this? A case for scoped record labels?

Brandon S. Allbery KF8NH allbery at ece.cmu.edu
Sun May 31 20:04:39 EDT 2009


On May 25, 2009, at 08:20 , ntupel at googlemail.com wrote:
> data HandshakeRequest = HandshakeRequest { channel :: String , ... }
> data HandshakeResponse = HandshakeResponse { channel :: String,
> successful :: Bool, ... }
> ...
>
> data BayeuxMessage = HSReq HandshakeRequest
>    | HSRes HandshakeResponse
>    ...
>
> This however does not work because record selectors have module scope,
> so the compiler will complain that channel et. al. are defined
> multiple times. As a workaround I could put each type into its own

Try -XDisambiguateRecordFields?

-- 
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery at kf8nh.com
system administrator [openafs,heimdal,too many hats] allbery at ece.cmu.edu
electrical and computer engineering, carnegie mellon university    KF8NH


-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20090531/8c3a3bfb/PGP.bin


More information about the Haskell-Cafe mailing list