What are the most important abstractions in Haskell? Monads? Applicatives? [closed]
Asked Answered
C

3

20

I want to know which libraries, functions, and concepts I definitely should know about and how to use. Monad and the functions there is the typical example, but there are other good primitives to use in coding, like Arrows, Applicative, ... Who are they?

btw, I want to be up-to-date in the Haskell world, learning the new concepts, how is this done?

(the original title was: "Library primitives for coding", but this was changed)

Certainly answered 14/5, 2011 at 17:50 Comment(3)
On the off-chance you haven't read the typeclassopedia yet, do so.Hammerhead
It seems that the answer to this question is "learn as much as possible". There was given a lot of topics to dig into here.Certainly
The typeclassopedia was exactly what I wanted when I wrote this question. But it was not possible to "accept" that answer (therefore there is no accepted answer).Certainly
U
18

The best way to start your Haskell experience is to install The Haskell Platform, which has many of the libraries we think are important.

If you look at what abstractions ship in the base system, you'll see some things worth learning:

And don't forget the powerful tools:

Unstrap answered 14/5, 2011 at 17:53 Comment(4)
Well, these libraries are almost included in every Haskell distribution. The question was not about how to start Haskell programming, but to define the "toolbox" of the Haskell programmer.Certainly
The Haskell Platform is the standard tookit, I guess my point is, so have a look at what has been selected there. Some of the most important things are listed above.Unstrap
OK. The idea behind this question came from the times I have looked through the modules in the "standard library", finding interesting concepts, especially "Arrow". The texts about such concepts tend to be on blogs and in the haskell wikibook, therefore I wanted an overview of such.Certainly
Some good resources you might turn to: Learn you a Haskell for great good!, and more advanced, Patterns in FP.Unstrap
K
16

Basic libraries to know:

Common data-centric libraries:

Packaged concepts that you should know:

  • Monads, Monad Transformers (see base, mtl)
  • Applicative (see base)
  • Arrows (see base)
  • Software Transactional Memory (stm)
  • Extensible Exceptions (in base since ~GHC 6.8)
  • Dynamic programming in Haskell (See Data.Typeable in base)
  • Sparking (light-weight parallelism hints via parallel)
  • Concurrency (see Control.Concurrent in base)
  • Memoization (monad-memo, MemoTrie)

Semi-advanced concepts:

Testing, benchmarking, and infrastructure:

External tools, GHC helpers, GHC

  • threadscope
  • alex (lexer)
  • happy (a parser generator)
  • haddock (documentation system)
  • Haskell Program Coverage (HPC)
  • GHC manual, which includes information on things like
    • Different back-ends
    • Profiling
    • Debugging
    • Optimization
    • Language extensions

Type-centric knowledge

  • GADTs
  • Rank-N Types
  • Existentials
  • Functional Dependencies and Type Families
  • This list can go on and on, but you'll know where to look if you know the above.

How to stay up-to-date on Haskell without asking a stack-overflow question:

  • Read the papers accepted by ICFP and POPL
  • Read the papers rejected by ICFP and POPL (if you can find them)
  • Connect on the social networks, Haskellers seem big on
    • Twitter (start by following whoever follows Galois or any random Haskeller you know)
    • Reddit
    • Stack Overflow (message me if you need a link)
  • Read blogs (linked from reddit or planet.haskell.org)
  • Follow conversations on the haskell-cafe mailing list or IRC.
  • Attend Galois semi-weekly tech talks
Ketone answered 14/5, 2011 at 18:18 Comment(1)
For those of us not in Portland, it appears Galios posts the tech talks online at vimeo.com/channels/galois - I'll definitely be checking this out. Thanks, Galios!Davenport
J
14

I actually sketched a list/grouping of Haskell-related things by their practical importance a while ago; it looks like this:

Haskell Basics (necessary for anything)

  • Functions
  • Partial application, currying
  • Recursion
  • Higher order functions
  • Algebraic datatypes
  • Pattern matching
  • Type classes
  • Kinds
  • Functors
  • the IO monad

Practical Necessities (you'll probably need to know about these for Serious Work, even if per chance you don't use all of them)

  • Monads
  • Monad Transformers
  • The FFI
  • Laziness/Strictness, BangPatterns and the rest
  • GADTs
  • TypeFamilies
  • FunctionalDependencies

Not Necessarily Necessary, But Probably Useful

  • Applicative
  • Higher-Rank Polymorphism
  • OverlappingInstances
  • Lenses and alternate record systems (fcLabels and the rest)
  • Iteratees
  • Concurrent Haskell (forkIO, MVars, ...)
  • Software Transactional Memory
  • TemplateHaskell
  • RULES

Extracurricular (potentially fascinating but wholly unnecessary)

Jojo answered 14/5, 2011 at 19:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.