[Haskell-cafe] ANNOUNCE: tie-knot library

27 views
Skip to first unread message

Petr P

unread,
Dec 10, 2012, 3:58:53 PM12/10/12
to haskell-cafe

    Dear Haskellers,

I'd like to announce a small library "tie-knot":


"Ties the knot" on a given set of structures that reference each other by keys - replaces the keys with their respective values.  Takes Map k (v k) and converts into Map k v' where v' is the fixed point of v.

Motivation: I needed to assemble a finite-state machine from an external description where each node was described by some identifier. I needed a simple library that would replace all key referencess with the actual values.



- Petr Pudlak

Felipe Almeida Lessa

unread,
Dec 11, 2012, 7:38:43 AM12/11/12
to Petr P, haskell-cafe
Hey, Petr!

Have you considered licensing your library as BSD? Given the current
way that Haskell programs are compiled, your library is effectively
licensed as GPL and that will scare away many people from using it.

Cheers, =)
> _______________________________________________
> Haskell-Cafe mailing list
> Haskel...@haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>



--
Felipe.

_______________________________________________
Haskell-Cafe mailing list
Haskel...@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Ramana Kumar

unread,
Dec 11, 2012, 8:26:05 PM12/11/12
to Felipe Almeida Lessa, haskell-cafe
Using the GPL (or a strong copyleft free license) strengthens the free software community of which I thought the Haskell community is a part (or at least intersects substantially).

I'm not sure why people are recommending not to use it.
Let me counter with my recommendation against switching to the weaker BSD license, so readers don't get the impression that we all agree on this issue.

Brandon Allbery

unread,
Dec 11, 2012, 8:35:18 PM12/11/12
to Ramana Kumar, haskell-cafe
On Tue, Dec 11, 2012 at 8:26 PM, Ramana Kumar <Ramana...@cl.cam.ac.uk> wrote:
Using the GPL (or a strong copyleft free license) strengthens the free software community of which I thought the Haskell community is a part (or at least intersects substantially).

Haskell libraries are mostly BSD licensed, as is GHC itself.  (Oddly enough, GPL is not the only open source license.)

Since most Haskell stuff is BSD licensed, GPL can cause license conflicts that do not exist with most other Haskell libraries.  This is why GPL is not recommended for new Haskell libraries.

--
brandon s allbery kf8nh                               sine nomine associates
allb...@gmail.com                                  ball...@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net

David Thomas

unread,
Dec 11, 2012, 8:45:40 PM12/11/12
to Brandon Allbery, Ramana Kumar, haskell-cafe
On Tue, Dec 11, 2012 at 5:35 PM, Brandon Allbery <allb...@gmail.com> wrote:

> (Oddly enough, GPL is not the only open source license.)

There was no implication to the contrary.  It was stated that BSD is a *weaker* license - this is true in the sense that it has fewer requirements (in particular, no copyleft) - and that "strong copyleft" licenses such as the GPL should be preferred as they do more to bolster the free software community.  You can disagree with this claim (there are arguments both ways - delving into them is not my point here) but please try not to bring in straw men.

Jonathan Fischer Friberg

unread,
Dec 11, 2012, 8:50:39 PM12/11/12
to Ramana Kumar, haskell-cafe
On Wed, Dec 12, 2012 at 2:26 AM, Ramana Kumar <Ramana...@cl.cam.ac.uk> wrote:
Using the GPL (or a strong copyleft free license) strengthens the free software community of which I thought the Haskell community is a part (or at least intersects substantially).

I don't think it strengthens the community. If someone wants to make a change a library,
but not release the source, they cannot do that with GPL.
The idea behind GPL is that then, the change is forced to be released - which would, as you say, strengthen the community.
However, I think what would happen instead is that the person would simply not use the library in the first place.

So in short: GPL does not make people become a part of the community - it pushes them away.

Jonathan

Nicolas Trangez

unread,
Dec 11, 2012, 8:57:03 PM12/11/12
to haskel...@haskell.org
Note: IANAL
Actually the library is made available under the LGPL-3 license,
according to its README, not the GPL (although the latter is implicit,
of course).

In the Haskell world this does have a different effect compared to when
one uses the LGPL for, say, a C library though, since (at least for now)
GHC uses/defaults to static linking, which IIRC (though IANAL) turns the
LGPL into GPL, so this has a severe impact for application authors. This
might be something people aren't aware of when releasing Haskell
libraries using the LGPL.

I tend to use the LGPL myself for most library-style projects, and do so
as well for Haskell code (although I'm aware of the drawbacks), but I'm
perfectly fine with people linking the libs statically as long as they
comply to the license "as if they were using dynamic loading".

If anyone knows some standard license which boils down to "obligations
like LGPL but OK for static linking as well", please let me know.

Nicolas

David Thomas

unread,
Dec 11, 2012, 9:03:17 PM12/11/12
to Jonathan Fischer Friberg, Ramana Kumar, haskell-cafe
Right.  Like, if Linus hadn't bogged down the Linux kernel with the GPL license, it might have wound up as popular as BSD!

Both dynamics go on, and the question is which is more likely to dominate in a given case (and cumulatively).


Alexander Solla

unread,
Dec 11, 2012, 9:07:13 PM12/11/12
to David Thomas, Ramana Kumar, haskell-cafe
As a matter of fact, BSD is far more popular on the desktop than GPL.  And has a huge share of the mobile market.  Witness: OS X, iOS.

And none of this has anything to do with Haskell.  Petr can release *his* code with any license he wants.  Some licenses fit into *this* ecosystem better than others.  Suggestions have been made and we can all move on.

David Thomas

unread,
Dec 11, 2012, 9:13:13 PM12/11/12
to Alexander Solla, Ramana Kumar, haskell-cafe
... and OS X and iOS are clearly a win for the FLOSS community?

Ivan Lazar Miljenovic

unread,
Dec 11, 2012, 9:14:26 PM12/11/12
to Nicolas Trangez, haskel...@haskell.org
I too would like such a license; however, the closest I've seen is
LGPL + linking exception (which I believe is the license Malcolm
Wallace uses for the cpphs library, though not the executable).

>
> Nicolas
>
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskel...@haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe



--
Ivan Lazar Miljenovic
Ivan.Mi...@gmail.com
http://IvanMiljenovic.wordpress.com

Ramana Kumar

unread,
Dec 11, 2012, 9:30:57 PM12/11/12
to David Thomas, haskell-cafe
I wonder if this discussion has been had before in the Haskell community.
If so, pointers to archives could be of interest.

I'm glad to see that there are others who apparently share my concern about the fact that people are actively recommending that new libraries be licensed without copyleft.
The debate between strong and weak (or no) copyleft goes on in many quarters.
I know which side seems right and which I would argue for, and I think it's a debate worth having, but perhaps in a new thread.

At least for new libraries like Petr's, as Alexander said, the author can license however he wants.
I hope others won't be so quick to encourage authors to make different choices without first resolving this debate or pointing to specific harms/benefits for the library in question.

Mike Meyer

unread,
Dec 11, 2012, 11:07:54 PM12/11/12
to David Thomas, Alexander Solla, Ramana Kumar, haskell-cafe


David Thomas <davidle...@gmail.com> wrote:
>... and OS X and iOS are clearly a win for the FLOSS community?

Yes. The parts of it that are willing to use BSD-licensed software, anyway. Apple does release sources to some of their toys. They released all of OS X below the GUI level, for instance. Grand Central Dispatch should be checked out by anyone doing concurrent programming, but you may have to apply the language patches Apple released, or upgrade you language to their version. Etc.

Smart developers will give back only things they don't consider critical to their business, even if they have to morph their architecture to comply with the license. Look at Tivo - they use Linux, but last time I looked their FLOSS releases were far less interesting than what we got from Apple.
--
Sent from my Android tablet with K-9 Mail. Please excuse my swyping.

wren ng thornton

unread,
Dec 12, 2012, 12:19:51 AM12/12/12
to haskell-cafe
On 12/11/12 9:30 PM, Ramana Kumar wrote:
> I wonder if this discussion has been had before in the Haskell community.
> If so, pointers to archives could be of interest.

Indeed, the discussion has been had more than once. Alas, I'm too bogged
for time to look up the archives at the moment.


> I'm glad to see that there are others who apparently share my concern about
> the fact that people are actively recommending that new libraries be
> licensed without copyleft.

The big issue, and the reason for suggesting that people not use LGPL is
a technical one. Namely that due to GHC's heavy inlining etc, the things
distinguishing LGPL from GPL are no longer in force, and therefore using
the "LGPL" license for your library is equivalent to using the full GPL
license for your library. Given as using the full GPL is not usually
people's intent, it's important to make people aware of this issue. And
in so doing, we usually suggest the BSD license (or similar) as an
alternative.

Inevitably, however, after the details of this technical situation are
discussed (often followed by a debate over the proper interpretation of
the linking clauses of the GPL/LGPL), the thread then turns to arguments
over the merits of various licenses... which eventually peters out when
everyone is too upset to keep on with it, just as in every other
free/open-source community. I don't mean to sound jaded, but I've been
through the cycle more than a few times already. Perhaps this time
someone'll mine the archives and set up a wiki highlighting the posts
with insightful discussion (and insightful counterpoints) so we can
direct people there for the next time...

--
Live well,
~wren

David Thomas

unread,
Dec 12, 2012, 12:28:52 AM12/12/12
to wren ng thornton, haskell-cafe
IANAL, but reviewing what others have written, it sounds like it may be possible to maintain *some* distinction between LGPL and GPL in Haskell, but it's a different distinction than with an LGPL shared library, so even if applicable it's certainly worth being aware of.

It sounds (and I'd very much like clarification) like providing source of an application to users *without* license to redistribute, which can be built using an LGPL library, would be compliant - whereas if the library was GPL this would not be the case?

Petr P

unread,
Dec 12, 2012, 5:00:38 AM12/12/12
to Ivan Lazar Miljenovic, Nicolas Trangez, haskell-cafe
I asked that on SO: http://programmers.stackexchange.com/q/179084/61231
So far the best answer is wxWidget's license (LGPL + linking exception) which at least has been approved by OSI (although FSF approval would have been better).

Best regards,
Petr


2012/12/12 Ivan Lazar Miljenovic <ivan.mi...@gmail.com>

Joachim Breitner

unread,
Dec 12, 2012, 8:11:24 AM12/12/12
to haskel...@haskell.org
Hi,

Am Mittwoch, den 12.12.2012, 02:50 +0100 schrieb Jonathan Fischer
Friberg:
> On Wed, Dec 12, 2012 at 2:26 AM, Ramana Kumar
> <Ramana...@cl.cam.ac.uk> wrote:
> Using the GPL (or a strong copyleft free license) strengthens
> the free software community of which I thought the Haskell
> community is a part (or at least intersects substantially).
>
> I don't think it strengthens the community. If someone wants to make a
> change a library,
> but not release the source, they cannot do that with GPL.

this is not fully correct. Correct would be to say:
„If someone wants to make a change a library and distribute the
resulting programs without also sharing the source with the
recipient, they cannot do that with GPL.”

So it is fully acceptable under the GPL to change the library for your
own use, without sharing your code with anyone else.

If you create a web service based on the modified library, you do not
have to share the code (unless it is AGPL, but that is a different
license).

Also, if you want to sell the resulting program, you do not have to
publish the source publicly, as long as you offer the source to your
customers.

For LGPL, we can assume that all this holds; whether the additional
relaxation that LGPL provides over GPL apply to Haskell libraries seems
to be doubtful.

I hope that clarifies the situation a bit,
Joachim

--
Joachim "nomeata" Breitner
ma...@joachim-breitner.de | nom...@debian.org | GPG: 0x4743206C
xmpp: nom...@joachim-breitner.de | http://www.joachim-breitner.de/

signature.asc

David Thomas

unread,
Dec 12, 2012, 10:43:21 AM12/12/12
to Joachim Breitner, Haskell Cafe
Strictly speaking this is correct, and probably there's no one who would miss the gotcha on the list, but for the sake of completeness:

You can release the source only to people who you have provided the program, but *they* have the ability to redistribute it under the terms of the GPL.  As discussed elsewhere, this seems to be a difference between the LGPL and GPL, when dealing with Haskell libraries.  When using the LGPL, you must allow people to update the library, so must (in the absence of dynamic linking) provide the source, but you *may* prohibit redistribution of that source.  (IANAL...)

Herbert Valerio Riedel

unread,
Dec 14, 2012, 5:53:21 AM12/14/12
to Brandon Allbery, Ramana Kumar, haskell-cafe
Brandon Allbery <allb...@gmail.com> writes:

> Haskell libraries are mostly BSD licensed, as is GHC itself. (Oddly
> enough, GPL is not the only open source license.)

btw, what about GHC's reliance on the LGPLed GMP library? Doesn't that
already taint the whole GHC eco-system?

Quoting [1]:

| GMP is licensed under the GNU Lesser General Public License (LGPL), a
| kind of "copyleft" license. According to the terms of the LGPL,
| paragraph 5, you may distribute a program that is designed to be
| compiled and dynamically linked with the library under the terms of
| your choice (i.e., commercially) but if your program incorporates
| portions of the library, if it is linked statically, then your program
| is a "derivative"--a "work based on the library"--and according to
| paragraph 2, section c, you "must cause the whole of the work to be
| licensed" under the terms of the LGPL (including for free).
|
| The LGPL licensing for GMP is a problem for the overall licensing of
| binary programs compiled with GHC because most distributions (and
| builds) of GHC use static libraries. (Dynamic libraries are currently
| distributed only for OS X.) The LGPL licensing situation may be worse:
| even though The Glasgow Haskell Compiler License is essentially a
| "free software" license (BSD3), according to paragraph 2 of the LGPL,
| GHC must be distributed under the terms of the LGPL!


[1]: http://hackage.haskell.org/trac/ghc/wiki/ReplacingGMPNotes#ReasonsforReplacingGMPastheBignumlibrary

cheers,
hvr

Niklas Larsson

unread,
Dec 14, 2012, 7:21:48 AM12/14/12
to Herbert Valerio Riedel, Brandon Allbery, Ramana Kumar, haskell-cafe
Yes, if you link statically, if you want to distribute without giving away source (or relinkable object files) you can link dynamically or use integer-simple in your GHC.

Niklas

Från: Herbert Valerio Riedel
Skickat: ‎2012-‎12-‎14 11:55
Till: Brandon Allbery
Kopia: Ramana Kumar; haskell-cafe
Ämne: Re: [Haskell-cafe] ANNOUNCE: tie-knot library

Greg Fitzgerald

unread,
Dec 14, 2012, 2:20:27 PM12/14/12
to Niklas Larsson, Johan Tibell, Bryan O'Sullivan, Ramana Kumar, haskell-cafe, Herbert Valerio Riedel
> GHC's reliance on the LGPLed GMP library
...
> use integer-simple in your GHC

I think this can still use some attention.  GHC requires an integer library internally, so to switch to integer-simple, you need to build GHC from source.  Has anyone reviewed of the performance implications of this switch?

+the new GHC Performance Team, Johan and Bryan

Thanks,
Greg



On Fri, Dec 14, 2012 at 4:21 AM, Niklas Larsson <metan...@gmail.com> wrote:
Yes, if you link statically, if you want to distribute without giving away source (or relinkable object files) you can link dynamically or use integer-simple in your GHC.

Niklas
Skickat: 2012-12-14 11:55
Reply all
Reply to author
Forward
0 new messages