ANNOUNCE: syb-0.3

Hello all, Just a quick announcement: I've posted syb-0.3http://hackage.haskell.org/package/syb-0.3on Hackage. Changes from syb-0.2.2 include (from 'darcs changes'): * Add test for everythingBut * Add everythingBut (FIX 16http://code.google.com/p/scrapyourboilerplate/issues/detail?id=16 ) * Tests for ext2 * Add ext2 and friends (FIX 14http://code.google.com/p/scrapyourboilerplate/issues/detail?id=14 ) * Export primitive ext1 (since ext0 is exported as well) Please let me know if you have any problems with the new version, or if you have any comments. Thanks, Pedro

Hi all, /(I think something went wrong with my previous email, so if this is sent twice, I apologize) / Why do self referential structure omit the selector in record entries referencing themselves when converting to the regular data structure? For instance, when splicing the following data structure: data P = V {v::String} | II {i::Integer} | P { p::P } deriving Show $(deriveAll ''P "PFP") type instance PF P = PFP It generates the following code: ...generics@haskell.org data P_P_ = ... instance Constructor P_P_ where { conName _ = "P" conIsRecord _ = True } ... data P_P_p_ = instance Selector P_V_v_ where { selName _ = "v" } ... instance Selector P_P_p_ where { selName _ = "p" } type PFP = :+: (C P_V_ (S P_V_v_ (K String))) (:+: (C P_II_ (S P_II_i_ (K Integer))) (C P_P_ I)) instance Regular P where { ...generics@haskell.org from II f0 = R (L (C (S (K f0)))) from P f0 = R (R (C (I f0))) ... to R L C S K f0 = II f0 to R R C I f0 = P f0 } Why is the selector name in case of a self referencing record omitted? I would have expected something like this: type PFP = :+: (C P_V_ (S P_V_v_ (K String))) (:+: (C P_II_ (S P_II_i_ (K Integer))) (C P_P_ (S P_P_p_ I))) and likewise: from II f0 = R (L (C (S (K f0)))) from P f0 = R (R (C (S (I f0)))) ... to R L C S K f0 = II f0 to R R C S I f0 = P f0 } This gives problems when parsing these kind of structure, or am I missing something? kind regards, Maarten

Hi Maarten,
This looks like a bug to me, thanks for reporting. I will fix it soon.
Cheers,
Pedro
On Mon, Jan 17, 2011 at 17:08, lists@snowlion.nl
Hi all,
*(I think something went wrong with my previous email, so if this is sent twice, I apologize) * Why do self referential structure omit the selector in record entries referencing themselves when converting to the regular data structure?
For instance, when splicing the following data structure:
data P = V {v::String} | II {i::Integer} | P { p::P } deriving Show
$(deriveAll ''P "PFP") type instance PF P = PFP
It generates the following code:
...generics@haskell.org data P_P_ = ... instance Constructor P_P_ where { conName _ = "P" conIsRecord _ = True } ... data P_P_p_ = instance Selector P_V_v_ where { selName _ = "v" } ... instance Selector P_P_p_ where { selName _ = "p" } type PFP = :+: (C P_V_ (S P_V_v_ (K String))) (:+: (C P_II_ (S P_II_i_ (K Integer))) (C P_P_ I)) instance Regular P where { ...generics@haskell.org from II f0 = R (L (C (S (K f0)))) from P f0 = R (R (C (I f0))) ... to R L C S K f0 = II f0 to R R C I f0 = P f0 }
Why is the selector name in case of a self referencing record omitted? I would have expected something like this:
type PFP = :+: (C P_V_ (S P_V_v_ (K String))) (:+: (C P_II_ (S P_II_i_ (K Integer))) (C P_P_ (S P_P_p_ I)))
and likewise:
from II f0 = R (L (C (S (K f0)))) from P f0 = R (R (C (S (I f0)))) ... to R L C S K f0 = II f0 to R R C S I f0 = P f0 }
This gives problems when parsing these kind of structure, or am I missing something?
kind regards,
Maarten
_______________________________________________ Generics mailing list Generics@haskell.org http://www.haskell.org/mailman/listinfo/generics

Hi Pedro, On 01/17/2011 05:14 PM, José Pedro Magalhães wrote:
This looks like a bug to me, thanks for reporting. I will fix it soon. Great, I'm not very fluent in template haskell... Thanks,
Maarten
Cheers, Pedro
On Mon, Jan 17, 2011 at 17:08, lists@snowlion.nl mailto:lists@snowlion.nl
mailto:lists@snowlion.nl> wrote: Hi all,
/(I think something went wrong with my previous email, so if this is sent twice, I apologize) / Why do self referential structure omit the selector in record entries referencing themselves when converting to the regular data structure?
For instance, when splicing the following data structure:
data P = V {v::String} | II {i::Integer} | P { p::P } deriving Show
$(deriveAll ''P "PFP") type instance PF P = PFP
It generates the following code:
...generics@haskell.org mailto:generics@haskell.org data P_P_ = ... instance Constructor P_P_ where { conName _ = "P" conIsRecord _ = True } ... data P_P_p_ = instance Selector P_V_v_ where { selName _ = "v" } ... instance Selector P_P_p_ where { selName _ = "p" } type PFP = :+: (C P_V_ (S P_V_v_ (K String))) (:+: (C P_II_ (S P_II_i_ (K Integer))) (C P_P_ I)) instance Regular P where { ...generics@haskell.org mailto:generics@haskell.org from II f0 = R (L (C (S (K f0)))) from P f0 = R (R (C (I f0))) ... to R L C S K f0 = II f0 to R R C I f0 = P f0 }
Why is the selector name in case of a self referencing record omitted? I would have expected something like this:
type PFP = :+: (C P_V_ (S P_V_v_ (K String))) (:+: (C P_II_ (S P_II_i_ (K Integer))) (C P_P_ (S P_P_p_ I)))
and likewise:
from II f0 = R (L (C (S (K f0)))) from P f0 = R (R (C (S (I f0)))) ... to R L C S K f0 = II f0 to R R C S I f0 = P f0 }
This gives problems when parsing these kind of structure, or am I missing something?
kind regards,
Maarten
_______________________________________________ Generics mailing list Generics@haskell.org mailto:Generics@haskell.org http://www.haskell.org/mailman/listinfo/generics

Hi Maarten,
I think I fixed it; please try
http://hackage.haskell.org/package/regular-0.3.1
Cheers,
Pedro
2011/1/17 José Pedro Magalhães
Hi Maarten,
This looks like a bug to me, thanks for reporting. I will fix it soon.
Cheers, Pedro
On Mon, Jan 17, 2011 at 17:08, lists@snowlion.nl
wrote: Hi all,
*(I think something went wrong with my previous email, so if this is sent twice, I apologize) * Why do self referential structure omit the selector in record entries referencing themselves when converting to the regular data structure?
For instance, when splicing the following data structure:
data P = V {v::String} | II {i::Integer} | P { p::P } deriving Show
$(deriveAll ''P "PFP") type instance PF P = PFP
It generates the following code:
...generics@haskell.org data P_P_ = ... instance Constructor P_P_ where { conName _ = "P" conIsRecord _ = True } ... data P_P_p_ = instance Selector P_V_v_ where { selName _ = "v" } ... instance Selector P_P_p_ where { selName _ = "p" } type PFP = :+: (C P_V_ (S P_V_v_ (K String))) (:+: (C P_II_ (S P_II_i_ (K Integer))) (C P_P_ I)) instance Regular P where { ...generics@haskell.org from II f0 = R (L (C (S (K f0)))) from P f0 = R (R (C (I f0))) ... to R L C S K f0 = II f0 to R R C I f0 = P f0 }
Why is the selector name in case of a self referencing record omitted? I would have expected something like this:
type PFP = :+: (C P_V_ (S P_V_v_ (K String))) (:+: (C P_II_ (S P_II_i_ (K Integer))) (C P_P_ (S P_P_p_ I)))
and likewise:
from II f0 = R (L (C (S (K f0)))) from P f0 = R (R (C (S (I f0)))) ... to R L C S K f0 = II f0 to R R C S I f0 = P f0 }
This gives problems when parsing these kind of structure, or am I missing something?
kind regards,
Maarten
_______________________________________________ Generics mailing list Generics@haskell.org http://www.haskell.org/mailman/listinfo/generics

Hi Pedro, Thanks! Works excellent. Kind regards, Maarten On 01/18/2011 08:30 AM, José Pedro Magalhães wrote:
Hi Maarten,
I think I fixed it; please try http://hackage.haskell.org/package/regular-0.3.1
Cheers, Pedro
2011/1/17 José Pedro Magalhães
mailto:jpm@cs.uu.nl> Hi Maarten,
This looks like a bug to me, thanks for reporting. I will fix it soon.
Cheers, Pedro
On Mon, Jan 17, 2011 at 17:08, lists@snowlion.nl mailto:lists@snowlion.nl
mailto:lists@snowlion.nl> wrote: Hi all,
/(I think something went wrong with my previous email, so if this is sent twice, I apologize) / Why do self referential structure omit the selector in record entries referencing themselves when converting to the regular data structure?
For instance, when splicing the following data structure:
data P = V {v::String} | II {i::Integer} | P { p::P } deriving Show
$(deriveAll ''P "PFP") type instance PF P = PFP
It generates the following code:
...generics@haskell.org mailto:generics@haskell.org data P_P_ = ... instance Constructor P_P_ where { conName _ = "P" conIsRecord _ = True } ... data P_P_p_ = instance Selector P_V_v_ where { selName _ = "v" } ... instance Selector P_P_p_ where { selName _ = "p" } type PFP = :+: (C P_V_ (S P_V_v_ (K String))) (:+: (C P_II_ (S P_II_i_ (K Integer))) (C P_P_ I)) instance Regular P where { ...generics@haskell.org mailto:generics@haskell.org from II f0 = R (L (C (S (K f0)))) from P f0 = R (R (C (I f0))) ... to R L C S K f0 = II f0 to R R C I f0 = P f0 }
Why is the selector name in case of a self referencing record omitted? I would have expected something like this:
type PFP = :+: (C P_V_ (S P_V_v_ (K String))) (:+: (C P_II_ (S P_II_i_ (K Integer))) (C P_P_ (S P_P_p_ I)))
and likewise:
from II f0 = R (L (C (S (K f0)))) from P f0 = R (R (C (S (I f0)))) ... to R L C S K f0 = II f0 to R R C S I f0 = P f0 }
This gives problems when parsing these kind of structure, or am I missing something?
kind regards,
Maarten
_______________________________________________ Generics mailing list Generics@haskell.org mailto:Generics@haskell.org http://www.haskell.org/mailman/listinfo/generics
participants (2)
-
José Pedro Magalhães
-
lists@snowlion.nl