Request for comment on new package
Chris Wong
lambda.fairy at gmail.com
Tue Aug 6 07:55:42 UTC 2019
Hi David,
What are the use cases for such a package?
I'd love to see some examples of problems that can be solved with
Lazifiable.
Chris
On Tue, Aug 6, 2019, 19:25 David Feuer <david.feuer at gmail.com> wrote:
> I've put together a small package for lazifying record types. There's a
> "classy" version in Data.Lazify and a Generic-only version in
> Data.Lazify.Generic. A few examples are below. I'd love to hear comments on
> what looks good and what should be changed before I make the first release.
> As usual, names are the hardest part. Note especially that the operator
> ($~) is defined in *both* Data.Lazify and Data.Lazify.Generic, and that no
> operator corresponds to genericLazify. Hrmm mumble.
>
> lazify (1, 2) = (1, 2)
> lazify undefined = (_|_, _|_, _|_)
> lazify undefined = Sum (_|_, _|_, _|_)
>
> genericLazify (1,2) = (1,2)
> genericLazify undefined = (_|_, _|_, _|_)
> genericLazify (Sum (MyCon x y)) = ... oops, MyType isn't an instance of
> Lazifiable
>
> lazifyGeneric (1,2) = (1,2)
> lazifyGeneric undefined = (_|_, _|_, _|_)
> lazifyGeneric (Sum (MyCon x y)) = Sum (MyCon x y)
>
> Thanks in advance,
> David
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20190806/c65d6012/attachment.html>
More information about the Libraries
mailing list