[Haskell-cafe] Any generic serializer to String? was: Any
working example of using genericserialize?
José Pedro Magalhães
jpm at cs.uu.nl
Thu Oct 1 08:06:56 EDT 2009
Hi Dimitry,
On Thu, Oct 1, 2009 at 05:23, Dimitry Golubovsky <golubovsky at gmail.com>wrote:
> OK, I got it to work with gread/gshow.
>
> However I have noticed this:
>
> *Main> (gread $ gshow $ FuncExpr 0 [] (EmptyStmt 0)) :: [(Expression
> Int, String)]
> [(FuncExpr 0 [] (EmptyStmt 0),"")]
>
> vs.
>
> *Main> (gread $ gshow $ FuncExpr () [] (EmptyStmt ())) :: [(Expression
> (), String)]
> []
>
> Or even narrower:
>
> *Main> (gread $ gshow 1)::[(Int, String)]
> [(1,"")]
>
> vs.
>
> *Main> (gread $ gshow ())::[((), String)]
> []
>
> that is, the unit type does not work well with gread/gshow, likely
> because inner parentheses are not parsed as a constructor.
>
> *Main> gshow ()
> "(())"
>
> Is this a known bug?
>
I don't think this was noticed before. I wrote it down on the SYB tracker
[1]. It should be fixed for the next release.
Thanks,
Pedro
[1] http://code.google.com/p/scrapyourboilerplate/issues/detail?id=9
>
> Thanks.
>
> On Wed, Sep 30, 2009 at 10:19 AM, Dimitry Golubovsky
> <golubovsky at gmail.com> wrote:
> > Bulat,
> >
> > OK, gread/gshow seem to be like the basis primitives. If they work
> > properly, then it is what is needed.
> >
> > Thanks.
> >
> > On 9/30/09, Bulat Ziganshin <bulat.ziganshin at gmail.com> wrote:
> >> Hello Max,
> >>
> >> Wednesday, September 30, 2009, 5:53:37 PM, you wrote:
> >>
> >> afaik, SYB just provides gshow/gread functions what serialize any Data
> >> instance to String
>
> --
> Dimitry Golubovsky
>
> Anywhere on the Web
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20091001/146e899c/attachment.html
More information about the Haskell-Cafe
mailing list