Top products from r/haskell

We found 62 product mentions on r/haskell. We ranked the 66 resulting products by number of redditors who mentioned them. Here are the top 20.

Next page

Top comments that mention products on r/haskell:

u/binarybana · 2 pointsr/haskell

It sounds like you may want to take the same approach you mentioned in your C++ code, but in a functional way. I'd recommend taking a look at some of Bird's functional pearls such as [1] or look in his book [2] for a great variety, as he often takes the approach of: "okay, lets start with the obvious and (often) intractable approach of generating all possible graphs, and then filter that list." Then he goes one step at a time to generate the solutions more efficiently by taking advantage of the properties of the problem until he often arrives at quite efficient (and elegant) solutions.

Haskell's laziness can be a great benefit here as Flarelocke mentioned: you only generate functions as your filter evaluation function needs them. So the essence of your program might be: filter graphPass efficientGenerateGraph.

I also recommend you look at the Inductive graph library [3] as it is a much more mature graph library as evidenced by Ivan's wonderful supporting libraries such as graphalyze [4], graphviz, . It took me a bit of a learning curve to wrap my head around it, but once you get it (just ignore all the monadic interfaces at first for instance) then it is a joy to work with.

To see some 'real' code that uses fgl then you can look at my code which does some computational biology inference/modeling using it. I've tried to document the code, but I could have done a better job. [5]

[1] - http://www.cs.tufts.edu/~nr/cs257/archive/richard-bird/sudoku.pdf

[2] - http://www.amazon.com/Pearls-Functional-Algorithm-Design-Richard/dp/0521513383

[3] - http://hackage.haskell.org/package/fgl

[4] - http://hackage.haskell.org/package/Graphalyze-0.11.0.0

[5] - https://bitbucket.org/binarybana/grn-pathways

u/SirRockALot1 · 29 pointsr/haskell

While LYAH is a fantastic book, I also felt a bit lost after reading it. You're still kinda useless as a Haskell programmer, all the practical things like 'drawing to the screen', 'calling a web API' are not included and bread & butter concepts like monad transformers, arrays/vectors, exceptions, any form of parallelism / concurrency, widely used language extensions etc., required to use/understand many libraries, are not discussed.

I can recommend Real World Haskell as a second book. Skip the basic early chapters and some of the outdated stuff, and you're still left with enough good parts. Also the Parallel and Concurrent Haskell book is truly excellent. It's written in a way that should make it accessible to someone with just LYAH under their belt. Both are available online for free, btw.

I haven't personally read it, but some people here recommend this book:
www.amazon.com/Beginning-Haskell-A-Project-Based-Approach/dp/1430262508/

Also, have you seen this great collection:

http://dev.stephendiehl.com/hask/

? That should give you a good introduction to many of the advanced concepts.

I would also recommend to check out 24 days of hackage to get a good idea of Haskell's library ecosystem:

https://ocharles.org.uk/blog/pages/2012-12-01-24-days-of-hackage.html
https://ocharles.org.uk/blog/pages/2013-12-01-24-days-of-hackage.html

Hope that helps, good luck! ;-)

u/edwardkmett · 19 pointsr/haskell

Types and Programming Languages by Benjamin Pierce covers type theory, and systems of type inference that we can have, and the ones we can't and why.

Pearls of Functional Algorithm Design by Richard Bird covers how to think equationally about code. It is probably the best guide out there on how to "think" like a Haskeller. Not directly about a discipline of math you can apply, but the mindset is invaluable.

Wadler's original papers on monads are probably when they finally clicked for me.

The original Idiom paper is also a golden resource for understanding the motivation behind applicatives.

Jeremy Gibbons' The Essence of the Iterator Pattern motivates Traversable, which so nicely encapsulates what folks meant by mapM over the years.

Uustalu and Vene's The Essence of Dataflow Programming captures a first glimmer of how and why you might want to use a comonad, but it can be fairly hard reading.

Awodey's Category Theory is probably the best general purpose category theory text book.

For folks weak on the math side Lawvere and Schanuel's Conceptual Mathematics can be used to bootstrap up to Awodey and provides a lot of drill for the areas it covers.

Dan Piponi's blog is excellent and largely set the tone for my own explorations into Haskell.

For lenses the material is a bit more sparse. The best theoretical work in this space I can point you to is by Mike Johnson and Bob Rosebrugh. (Pretty much anything in the last few papers linked at Michael's publication page at Macquarie will do to get started). I have a video out there as well from New York Haskell. SPJ has a much more gentle introduction on Skills Matter's website. You need to signup there to watch it though.

For comonads you may get some benefit out of my site comonad.com and the stuff I have up on FP Complete, but you'll need to dig back a ways.

u/gregK · 4 pointsr/haskell

>For this reason, if we want to convey the usefulness of FP to the imperatives amongst us, we need to focus on elegant solutions to real world inputs and outputs. We need to show how our I/O-libraries, often overlooked or thought of as mere “helpers”, are superior in efficiency and leads to cleaner and more maintainable code.

There are plently of articles and blog posts on the web on how to do IO, Effects, etc in haskell. I am all for learning to do practiacal stuff like writing to a file. BUT learning to get the most of pure funtions would probably yield the biggest wins in terms of code quality and ability to reason about it. Having worked for most of my career with imperative langauges, getting the most out of FP requires a whole new skill set. It's not enough to understand the concepts, you need to practice and read a lot of good functional code.

That's why I love books like Pearls of Functional Algorithm Design. We need more books and articles like that. Just the sudoku solver in there is an eye opener.

u/negativezero11 · 3 pointsr/haskell

It's quite pricey, but I recommend
Algebra for Programming by Richard Bird and Oege de Moor. The second chapter has a brief but lucid introduction to category theory insofar as it applies to a functional language like Haskell. It doesn't cover everything like adjunctions, but it's a great start (definitely easier than Awodey unless you already know a ton of algebra). The bonus here is that you can download solutions to some exercises as well!

You may also enjoy Computational Category Theory, although the examples are in Standard ML.

u/nbksndf · 6 pointsr/haskell

Category theory is not easy to get into, and you have to learn quite a bit and use it for stuff in order to retain a decent understanding.

The best book for an introduction I have read is:

Algebra (http://www.amazon.com/Algebra-Chelsea-Publishing-Saunders-Lane/dp/0821816462/ref=sr_1_1?ie=UTF8&qid=1453926037&sr=8-1&keywords=algebra+maclane)

For more advanced stuff, and to secure the understanding better I recommend this book:

Topoi - The Categorical Analysis of Logic (http://www.amazon.com/Topoi-Categorial-Analysis-Logic-Mathematics/dp/0486450260/ref=sr_1_1?ie=UTF8&qid=1453926180&sr=8-1&keywords=topoi)

Both of these books build up from the basics, but a basic understanding of set theory, category theory, and logic is recommended for the second book.

For type theory and lambda calculus I have found the following book to be the best:

Type Theory and Formal Proof - An Introduction (http://www.amazon.com/Type-Theory-Formal-Proof-Introduction/dp/110703650X/ref=sr_1_2?ie=UTF8&qid=1453926270&sr=8-2&keywords=type+theory)

The first half of the book goes over lambda calculus, the fundamentals of type theory and the lambda cube. This is a great introduction because it doesn't go deep into proofs or implementation details.

u/winterkoninkje · 1 pointr/haskell

Except that Mac Lane is only good if you are, indeed, a working mathematician.

A good introduction is Pierce, though it doesn't get into gritty details. For some of the grittier details, and for those on a budget, Adámek is freely available and is a good reference. However it definitely requires active reading and working through the examples, not just sitting down with a hot beverage.

Once you have the basics down, Google is your friend. A lot of folks in the Haskell community have blogs talking about various things.

u/gfixler · 3 pointsr/haskell

>When working in Java you just need to embrace it.

Haha. Agreed. When you're a hostage, just do what they say, and live to fight another day.

>...showed me how it's supposed to be done.

I've tried to see how it's supposed to be done many times, but it's just a broken abstraction for me. If I want to turn off a light, I flip the switch to off. In OOP, I'm supposed to create a Light class to hold the state of everything related to the light, then accessor methods with access control levels set up just so to protect me from the world, in case anyone wants to make something based on my whole lighting setup. Then I need to create nouns to shepherd my verbs around, like LightSwitchToggleAccessor, and worry about interfaces and implementations and design patterns.

In Haskell I'd say "A light can just be on or off; let's make it an alias for a boolean."

type Light = Bool

I want to be able to turn it on and off; that's just a morphism from Light state to Light state.

toggleLight :: Light -> Light
toggleLight = not

And that's it. If I realize later that I don't want Light and Bool to be interchangeable, I'd just make Light it's own type with a simple tweak to give it its own two states:

data Light = Lit | Unlit

And change the toggle to match:

toggleLight :: Light -> Light
toggleLight Lit = Unlit
toggleLight Unlit = Lit

Then I could toggle a big list of lights:

map toggleLight [light1, light2, mainLight, ...]

Or turn them all on:

map (const Lit) [light1, light2, ...]

I have equational reasoning. I can do like-for-like transformations. I get all the goodness of category theoretic abstractions, giving me reusability the likes of which I've never seen in OOP (not even close). Etc.

>objects are closures

Closures are immutable (hence the glory of this). Objects tend to be mutable, which is a nightmare (every day where I work in C#).

>try to keep as much stuff pure as possible

But you just have no way of knowing what's pure and what isn't in any of the OOP environments I've seen, and it is so obvious in C# at work; it plagues us constantly - new bugs daily, and projects always slow tremendously as they grow, and things become unchangeable, because they're too ossified. Just that small thing, that need to specify effects in your types, makes it so much easier to reason about what actually goes on in a function. For example, my Lights up there actually can't do anything in the world. I know that because of their "Light -> Light" types. All they can do is tweak data, the same way every single time they're called - you can replace them with table lookups. They'd have to get some kind of IO markup in their types before they could change anything, which is part of that equational, deterministic reasoning that makes FP so easy to understand, even as projects grow.

I don't want to try to do things. I want it to be fun to do what's good, and impossible to do what's bad. The goal of a great type system is to "make illegal states impossible to represent." I made it impossible to mess with the world, and so I can know with 100% certainty what toggleLights does. I quite literally cannot know what the same function would do in C#. It could return a different result every time. Multiply that up to a few 100klocs, and I have no idea how our projects work, and no idea what I'm breaking when I push commits (and I often break things, and everyone else constantly breaks my stuff, because we can't properly reason about anything).

u/apfelmus · 4 pointsr/haskell

In my opinion, "Algebra of Programming" is really a book about understanding optimization algorithms like dynamic programming, greedy algorithms, divide-and-conquer etc. in a unified manner, guided by category theory.

In other words, it is intended to be applied to problems like [linear paragraph formatting][1] or counting word numbers, though the style is a lot more abstract in the book. This is extremely interesting stuff, but also a little niche.

I can't say anything about Elements of programming, because I have never heard of this book.

If you want a more down-to-earth version of "Algebra of Programming", I would recommend Richard Bird's [Pearls of functional algorithm design][3]. It covers different material, but Bird has a very mathematical/structured approach to programming that is definitely worth learning from.

[3]: http://www.amazon.com/Pearls-Functional-Algorithm-Design-Richard/dp/0521513383

[1]: http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.33.7923

u/ephrion · 3 pointsr/haskell

I don't think type theory is what you're looking for. Type theory (and programming language theory) are mostly interesting from the perspective of a language designer or implementer. If you're just looking to upgrade your Haskell skills, then focusing on specific libraries and techniques will be faster.

With that said, here's my type theory track:

  • Type Theory and Formal Proof is a fantastic introduction to the lambda calculus, starting with the simple untyped lambda calculus and exploring each of it's additions. It's very friendly to novices, and includes a guide to Greek letters and an introduction to sequent notation (the weird horizontal bar logical notation). Ultimately, it develops the Calculus of Constructions with Definitions which can be used to prove things using constructivist logic.
  • Types and Programming Languages is a good read after that. It also starts with the untyped lambda calculus, and develops extensions on top of it. You'll implement a type checker and interpreter for the simply typed lambda calculus, and you'll add subtyping, record types, type inference, objects (!!!), parametric polymorphism, and existential types.
u/biglambda · 12 pointsr/haskell

I highly recommend The Haskell School of Expression by the late great Paul Hudak. Also you should learn as much as you can about Lambda Calculus in general like for example this paper.
After that you should learn as much as you can about types, Types and Programming Languages is really important for that.
Finally don't skip the important fundamental texts, mainly Structure and Interpretation of Computer Programs and the original video lectures by the authors (about the nerdiest thing you will ever watch ;)

u/bjzaba · 3 pointsr/haskell

Type theory is a different, though related field to category theory. I've found this to be an excellent book to start off, they might have it in your library: https://www.amazon.com/Type-Theory-Formal-Proof-Introduction/dp/110703650X - it's less focused on implementing type systems like Pierce's 'Types and Programming Languages' book, so it allows you to ramp up quickly to get to the juicy CoC stuff :)

u/artemshitov · 7 pointsr/haskell

An Introduction to Functional Programming Through Lambda Calculus by Greg Michaelson is a great intro book about both lambda calculus and functional programming that may be easier to digest: http://www.amazon.com/Introduction-Functional-Programming-Calculus-Mathematics/dp/0486478831. Also, it seems, available for free as a PDF: https://www.cs.rochester.edu/~brown/173/readings/LCBook.pdf

u/JeffB1517 · 11 pointsr/haskell

Haskell is a really complicated language that demands of a lot. It may not be possible.

Making it more popular though:

As others have mentioned the tooling is complicated. Haskell has the same problem Tex had. Stack and Haskell platform get part of the way there but the installers need to configure editors and project tools to work out of the box fully configured. In particular include a fully configured Leksah or Geanny or Kate.

Finally and this will be controversial. Strip options. There is one easy web framework with a note in the documentation of where to find the full featured but hard one. The database is preconfigured out of the box (SQLite or something), a script for say MySQL and Mongo (single node on desktop) and then a link to how to do it for a real setup. Because the options are simple there can be a simple management tool to make minor changes to the environment.

Then include targeted tutorials for that environment.

Paul Hudak's environment for https://www.amazon.com/Haskell-School-Expression-Functional-Programming/dp/0521644089/
was perfect. It got a Haskell, an editor and enough of an environment to do graphics and sound programming.

Basically Haskell platform got too focused on Haskell libraries and not focused enough on ecoystems. Make a Haskell the way Microsoft, Adobe or Apple would make a Haskell.

u/atium_ · 9 pointsr/haskell

Not what you are asking for really, but you'll get better with experience.


Take a few imperative algorithms and convert them over.
Solve some problems on HackerRank. Do it your way, afterwards compare your solution with some of the other Haskell solutions.


Some functional algorithms and data structures are done very differently. Chris Okasaki has a book Purely Functional Data Structures that covers some (though its for ML)


There are papers/articles on topics such as Functional Binomial Queues and Hinze has got a paper on Priority Search Queues that also covers an implementation of Dijkstra and Prims.


The Haskell Wiki has got a page listing functional pearls. Maybe also take a look at how dynamic programming and such paradigms are done functionally.

For most algorithms you can write it in a imperative manner and use mutation and looping constructs, if you have to. But you aren't going to find some guide to convert any algorithm into idiomatic Haskell. Some functional implementations require you to think differently.

u/FunctionalGopher · 1 pointr/haskell

I've dug into several haskell books and resources online and as crazy as it sounds my favorite book was: :https://www.amazon.com/Haskell-Cookbook-functional-applications-Applicatives-ebook/dp/B073QW9LS3/ref=sr_1_2?ie=UTF8&qid=1527444265&sr=8-2&keywords=Haskell+Packt

It's practical, short, gets you building projects, and has very clean examples and pictures. Very simple and easy to digest explanations.

u/Herald_MJ · 2 pointsr/haskell

I've found Haskell: The Craft of Functional Programming to be great. RWH is naturally better for real-world examples though. That would be CoFP's main downfall.

u/itkovian · 20 pointsr/haskell

I can highly recommend Okasaki's book on data structures: https://www.amazon.com/Purely-Functional-Data-Structures-Okasaki/dp/0521663504, if you are looking for inspiration or techniques.

u/ReinH · 3 pointsr/haskell

Try Bird's Introduction to Functional Programming using Haskell, which this seems to be an update of! One of the best books on FP ever written IMO. And his Pearls of Functional Algorithm Design. And (it's a bit pricey though!) his Algebra of Programming.

u/NLeCompte_functional · 2 pointsr/haskell

I have not read Functional Programming In Scala so I am unsure of the scope.

But Purely Functional Data Structures is a classic: https://www.amazon.com/Purely-Functional-Data-Structures-Okasaki/dp/0521663504


It's largely focused on SML, but all the examples are also given in Haskell. And for learning Haskell (or Scala/F#/Agda/etc), porting the SML examples is a good exercise.

u/co_dh · 3 pointsr/haskell

To answer your general question: To use a parameter more than once, you need to duplicate your parameter like:
dup :: a -> (a, a)
Then you call two functions on each.

Algebra of Programming could help you.

https://www.amazon.ca/Algebra-Programming-Richard-Bird/dp/013507245X

u/jberryman · 1 pointr/haskell

Sounds awesome. Think I'll pick up this book and maybe in a year I'll not be utterly unqualified for this.

u/tel · 49 pointsr/haskell

To first approximation, everything with the words "functional pearl" in it. A short list of ones I've read and enjoyed

  • Brent Yorgey's Monoids: Theme and Variations
  • Janis Voigtlander's Bidirectionalization for Free!
  • McBride and Patterson's Applicative programming with effects
  • Gibbons, Lester, and Bird's Enumerating the Rationals (I talked about this one here)
  • Mark Jones' Composing Fractals
  • Conor McBride's i am not a number--i am a free variable
  • Stephanie Wierich's Type-Safe Cast
  • Koen Claessen's A Poor Man's Concurrency Monad
  • Ralf Hinze's Explaining binomial heaps
  • M. Douglas McIlroy's Power series, power serious
  • Hutton and Meijer's Monadic parsing in Haskell
  • Gerard Huet's The Zipper
  • Jeremy Gibbons' The Third Homomorphism Theorem
  • Stephan Dolan's Fun with Semirings

    Also the entirety of Bird's book Pearls of Functional Algorithm Design is great. For an example, take a look at his sudoku solver

    And more...
u/eat_those_lemons · 1 pointr/haskell

That makes sense, I guess I am slightly despairing because it is such a huge project and I am a sole developer and because of how much it is all tied together it takes a full day to just add a simple button, and to add all the changes all through the code base

​

Thanks for the a) reassurance and b) the recommendation

​

When you say SICP do you mean this book? https://www.amazon.com/Structure-Interpretation-Computer-Programs-Engineering/dp/0262510871/ref=asc_df_0262510871/

u/emarshall85 · 3 pointsr/haskell

I really liked the 2nd edition, though I found myself growing impatient, having already read LYAH by the time I found that book. Pre-ordered, regardless. Happy birthday to me! Kindle edition was immediately available, so I didn't have to wait for my birthday.

PS - available for pre-order on amazon.com Didn't realize the reddit entry linked to amazon already. Whoops... << walks out quietly >>

u/globules · 2 pointsr/haskell

For what it's worth, I'm currently reading Bird & Wadler's Introduction to Functional Programming and they use list comprehensions quite heavily. It's from 1988 though... :-)

u/snatchinvader · 7 pointsr/haskell

A good book describing similar techniques for designing and implementing efficient data structures with lazy evaluation is Purely Functional Data Structures.

u/dalaing · 2 pointsr/haskell

I like Pearls of Functional Algorithm Design, but for anyone who gets lost in that I recommend Introduction to Functional Programming using Haskell.

It starts off introductory, but it covers a lot of material, and covers it in depth.

u/jaybee · 5 pointsr/haskell

It depends in part on why you didn't like RWH but Bird is a classic. It introduces lots of important ideas such as deriving programs from algebraic properties of functions. Read The Haskell Road too.

u/Lossy · 5 pointsr/haskell

You joke but that style is actually used in The Algebra of Programming

u/ignorantone · 5 pointsr/haskell

> I'm not aware of anything that covers ... lens in book form

Beginning haskell has an introduction to lens.

In addition, there are a few lens tutorials out there on the web; google for them.

u/ryfm · 2 pointsr/haskell

An Introduction to Functional Programming Through Lambda Calculus

a beginner level book; helped me when i started looking into FP & Lambda calculus.

http://www.amazon.com/Introduction-Functional-Programming-Calculus-Mathematics/dp/0486478831

u/rdfox · 4 pointsr/haskell

I shelled out the twenty bucks for Thinking Functionally in Haskell (oh shit, it's gone up to $37). Can't say I'm disappointed. Good combination of exercises and deep thoughts.

u/gtani · 1 pointr/haskell

Thompson's book was updated in 2011, and the Apress book looks like a good learning resource generally but I haven't read beyond a few chapters. There's a few odd typos where Mena writes "Platform does something" and he means GHC.

(Also, how about Bird's Pearls book? Hudak, School of Music?)

http://www.haskellcraft.com/craft3e/Home.html

http://www.amazon.com/Beginning-Haskell-A-Project-Based-Approach/dp/1430262508

u/kqr · 6 pointsr/haskell

This is a completely unhelpful answer, but if you're looking to get to know the things you listed under not comfortable, there is