Best products from r/haskellquestions

We found 3 comments on r/haskellquestions discussing the most recommended products. We ran sentiment analysis on each of these comments to determine how redditors feel about different products. We found 3 products and ranked them based on the amount of positive reactions they received. Here are the top 20.

Top comments mentioning products on r/haskellquestions:

u/ephrion · 4 pointsr/haskellquestions

> How long did it take you to learn haskell to a useful degree?

Useful Haskell is a much lower bar than social media Haskell: this excellent post shows the "Haskell Pyramid," where useful and practical code can be achieved without learning anything too crazy.

Here's a brief list of things you don't need to know to write useful Haskell:

  • technical terms like *morphisms,
  • what exactly a functor is,
  • what linear types entail,
  • why type checking is necessary and how it is implemented in haskell.

    Here's some great resources for Useful Haskell:

  • Write an app! you're doing that already, so cool.
  • The Yesod Book is a great intro to web development in Haskell. Yesod is lighter and more modular than Ruby on Rails, but has more batteries included than any other framework in the language.
  • Parallel and Concurrent Programming in Haskell provided a fantastic overview of the two topics, along with GHC's exceptions and a bit of a dive into the IO execution model.
  • Stanford CS240H course is excellent with lower level information on GHC and IO.

    ---

    I don't mean to suggest that an interest in the things you mentioned is bad or not worth pursuing -- they're really cool! But my study of category theory, type theory, etc. has not meaningfully improved my performance at my day job of writing Haskell.

  • For an explanation of morphisms, you'll enjoy Bartosz Milewski's book on category theory, or alternatively recursion schemes.
  • Haskellbook is a great resource for the main type classes; I find that it has the best explanations and exercises for drilling intuition. "What exactly is a functor?" is a question that's only answerable by specifying the context -- C++, prolog, category theory, OCaml, and Haskell functors are all different.
  • A value with a linear type must be used exactly one. You can't duplicate it or drop it. There's not a lot of books on this, mostly papers and blog posts. Rust has affine types, which are similar, but they only require that a value is used at most once.
  • Why is type checking necessary? Strictly speaking, it isn't -- there are dynamically typed languages, after all. Types and Programming Languages is a great book that teaches about a wide variety of type systems, though it spends quite a lot of time on subtyping and object oriented type systems. If you're mostly interested in FP and Haskell type systems, you can skip those sections. I really enjoy Type Theory and Formal Proof as an introduction to sequent notation; it builds up the lambda calculus and explores each variant/extension until it develops the final Boss Mode "Calculus of Constructions" that is dependently typed and forms the basis of theorem proving languages like Coq and Agda. Haskell's type system is based on System Fw. Types are also extremely useful in optimization and compilation.
u/ignorantone · 3 pointsr/haskellquestions

The "entity3 gameState5 garbage" is more elegantly handled with the State/StateT monad. You may also want to check out the lens library. Lens + State monad is probably what you're looking for.

Check out [real world haskell chapter on monads (including State)] (http://book.realworldhaskell.org/read/monads.html) And google for some Lens tutorials online. I liked the chapters on State (and other monads) and the introduction to the Lens library in http://www.amazon.com/Beginning-Haskell-A-Project-Based-Approach/dp/1430262508

Also, you don't need to do:

let (entity, gameState') = createEntity gameState player
let square = createSquare (12 float2Double normalScale) (16 float2Double normalScale)

Instead do:

let (entity, gameState') = createEntity gameState player
square = createSquare (12 float2Double normalScale) (16 float2Double normalScale)