I am not a number: I am a free variable. -- Conor McBride
I am not a free variable, I am a free monad! -- Edward Kmett
Informally, a free object over a set A can be thought as being a "generic" algebraic structure over A: the only equations that hold between elements of the free object are those that follow from the defining axioms of the algebraic structure.
Let (C,F) be a concrete category (i.e. F: C → Set is a faithful functor), let X be a set (called basis), A ∈ C an object, and i: X → F(A) a map between sets (called canonical injection). We say that A is the free object on X (with respect to i) if and only if they satisfy this universal property:
for any object B and any map between sets f: X → F(B), there exists a unique morphism g: A → B such that f = F(g) o i.
In this way the free functor that builds the free object A from the set X becomes left adjoint to the forgetful functor.
There are several ideas running interleaved through my head at the moment (in no particular order):
- Vectors, lists, trees, complex numbers, "7 trees in one"
- Combinatorial species, calculi, "programming" languages
- Conor's answer about cursors and comonads  (and his thesis...)
- Monads joining, duplicating, returning, (aka "binding"), extracting (aka "cojoining"), Clowns and Jokers, Leibniz (and "Triples" :P)
- Adjoints, adjucnctions, holes, continuations, representations, Yoneda, Kan extensions, machines, and homotopy
- "All concepts are Kan extensions"
- Points, lines, circles, Euclid and Cartesian-ness
- Completeness, incompleteness, and causality
- Logic, type theory, syntax, semantics, Truth, and communication
- Peter Hancock's "AMEN" paper, logarithms, Church Numeral / Turing Machine duality, specifically "And so, lambda-calculus and Turing machine are duals: In a (universal) TM, an integer encodes an operation. In lambda-calculus, an operation encodes an integer." Numerals and lists in lambda-calculus: P-numerals
- Church vs. Curry typing and other paradigmatic "dualities"
- Lawvere's fixed point theorem, Yanofsky's exposition, and "heterological"
- Lenses, prisms, isos, traversals, and telescopes.
- What the Tortoise said to Achilles.
- Terminology is a minefield
- How, where, when, why, to what, to who any of these things matter (theoretically, pedagogically, and practically) and their "connections"?
- Whether this is all just a bunch of abstract nonsense and should forget about it?
- Much else
- Last, but certainly not least, bad puns :)
Just thinking out loud... Other than that, just thought I would stop by and say hello. I'll be updating with other references if anyone else is interested. Anyhow, back to the trenches.
: Writing cojoin or cobind for n-dimensional grid type "Jagger/Richards: you can't always get what you want, but if you try sometime you just might find that you get what you need."submitted by ShadowyOrdeal
[link] [1 comment]
I ran across this in /r/python today:
I thought it was a very good collection of anti-patterns. But I also realized that the vast majority of those anti-patterns, the bits of code you should not write, are impossible to write in Haskell, and this made me feel a bit smug.
This is not really news, because static typing solves so many problems that duck-typed languages create. But some of the items that stood out to me were:
- Never return more than one value from a function
- Never use the global statement
- Don't compare things to None using the == operator
- Do not use type() to compare types, use instance of Of course this is kind of an apples-to-oranges comparison, given that Python and Haskell's typing system are completely different.
- Use dict comprehensions to make dictionary initialization more readable Haskell has supported list comprehensions from the beginning.
- Always use zip() to iterate over lists
You can educate your developers to avoid these anti-patterns, or you could use just use a statically typed language and have the type checker enforce these rules for you.
It blows my mind that anyone would even consider using Python for large software projects, or anything apart from simple ad-hoc scripting to automate simple day-to-day tasks.submitted by Ramin_HAL9001
[link] [14 comments]
For example, Data.HashSet's toList can return different orders of values for sets s1 and s2 where s1==s2 is true, if set elements with identical hash values are inserted into s1 in a different order than they are inserted into s2. See the section "Example 3" for a sample session (after the corresponding one for Clojure).
In chatting with a few Haskell developers, some consider this a bug. At least for Data.HashSet's toList, it seems to me the easiest 'bug fix' would be to eliminate toList completely, unless a total order is given for the set elements.
Chris Okasaki's Edison library takes the approach of including functions violating this property, but documents them as ambiguous ("Notes on ambiguous functions" section here).
I am curious to hear reasons for considering this kind of behavior a bug to be eliminated, versus the approach of documenting it.submitted by jafingerhut
[link] [96 comments]
Are there any that stand out as the most well supported and actively used? My recent dive into Haskell has caused me to wonder if the community has a tendency to use a certain database / subset of databases.
It seems like PostgreSQL is definitely a top pick. What about NoSQL?submitted by broma0
[link] [39 comments]
I've checked Classy-Prelude but seems like it favors backwards compatibility instead of robustness, declaring typeclasses for namespacing purposes instead of "fixing" them by defining properly polymorphic functions.
I'm interested in a more radical, fully-generic rewrite of the Prelude, in which functions are as generic as they can be.
Does such a thing exist?submitted by SrPeixinho
[link] [38 comments]
I really would like to buy a TShirt with the amazing Thompson-Wheeler logo, I have seen several possibilities, but I would like to make sure my money is going to people actually working on the language, is there any way to do so?
Otherwise, I might start making Haskell-related TShirts on my own, what would be the best way to give back to the Haskell community with the money I might raise?submitted by Vetii
[link] [12 comments]
The Prime Minister of Singapore, Lee Hsien Loong, plans to learn Haskell.
My children are in IT, two of them – both graduated from MIT. One of them browsed a book and said, “Here, read this”. It said “Haskell – learn you a Haskell for great good”, and one day that will be my retirement reading.Spotted by Jeremy Yallop.
I came across this beautiful tutorial - http://www.renci.org/wp-content/pub/tutorials/BeautifulCode.pdf
I noticed though it's about 7 years old now and things have moved pretty fast as far as opengl standards, opengl tooling in haskell, haskell practices, and data science since then.
Is there an updated equivalent of this tutorial? Is anything there obviously out of date now?submitted by klaxion
[link] [2 comments]