Looking for idiomatic example of wrapping a Haskell library

Hi Haskellers, In a Haskell learning project I'm looking at using a couple of Haskell packages (from Hackage) for linear algebra and graphics. I've got a strong feeling my choices of these libraries are going to change as the project progresses and to avoid having to change references to these library functions throughout my modules I'd like to "wrap" them in modules of my own. Can anyone point me to a project where a Haskell library has been idiomatically wrapped this way? I can see newtypes and "smart" constructors of the wrapped types will go some way towards this, but I suspect there's more techniques I haven't yet learned. Thanks in advance, Stu

For the specific choices of linear algebra and graphics, I'm going to go out on a limb and guess you probably don't want to do that. Different frameworks have radically different APIs, so a "generic" wrapper is likely to give you a slow subset of the functionality of each package. On Tue, Nov 24, 2020, 10:29 PM Stuart Hungerford < stuart.hungerford@gmail.com> wrote:
Hi Haskellers,
In a Haskell learning project I'm looking at using a couple of Haskell packages (from Hackage) for linear algebra and graphics.
I've got a strong feeling my choices of these libraries are going to change as the project progresses and to avoid having to change references to these library functions throughout my modules I'd like to "wrap" them in modules of my own. Can anyone point me to a project where a Haskell library has been idiomatically wrapped this way?
I can see newtypes and "smart" constructors of the wrapped types will go some way towards this, but I suspect there's more techniques I haven't yet learned.
Thanks in advance,
Stu _______________________________________________ Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.

On Wed, Nov 25, 2020 at 2:38 PM David Feuer
For the specific choices of linear algebra and graphics, I'm going to go out on a limb and guess you probably don't want to do that. Different frameworks have radically different APIs, so a "generic" wrapper is likely to give you a slow subset of the functionality of each package.
Thanks David -- that's a good point I hadn't really considered. Stu
participants (2)
-
David Feuer
-
Stuart Hungerford