News

To concatenate two Python iterators, we use `chain`

. The corresponding Haskell function is `(++)`

. The `chain`

function is variadic, whereas the `(++)`

function is an infix operator; both are fine ways to make nested application more convenient.

The latest lesson in the Python course is about functions that produce simple never-ending iterators. The ability to represent concepts like “counting upward from one” and “repeating an item indefinitely” is a big part of what distinguishes iterators from lists in Python. In Haskell we describe things like Python iterators as “lazy” because elements are not evaluated until they are needed. Python lists, in contrast, we describe as “strict”.

We previously discussed in the iterators lesson how Python iterators relate to Haskell lists. If you’re familiar with the `itertools`

module, these next lessons will help you get started quickly with Haskell’s `Data.List`

module. We begin with a discussion of `islice`

.

We’ve added an article comparing Python iterators to Haskell lists. There’s also a new lesson of Functortown. Lesson 9, *You got monoids in my functors!*, goes further into Applicative functors. This lesson is supplemented by a reference page on Semigroup.

This week’s theme is *applicative functors*. The eighth lesson of Functortown is called *Mapping a Maybe function*; it starts off with a concise practical example that brings the `Maybe`

applicative to our attention. We’ve also written the reference page on the `ApplicativeDo`

extension.

Courses

*Courses* are series about a particular topic meant to be watched in order. Some will be more theory-and-fundamentals oriented, while some will focus on building a project. Each course has clearly identified prerequisites and goals, to help you choose which courses are right for you.

`Text`

and `ByteString`

types.`Functor`

, `Bifunctor`

, `Applicative`

, `Traversable`

, `Monad`

, `Contravariant`

, and `Profunctor`

, with motivating examples and discussions of what each is good for, the laws governing each, and how to property test instances.`fltkhs`

and Chris using `gtk3`

. Each lesson explains aspects of the library, illuminates important Haskell concepts such as concurrency primitives and implicit parameters, and gives you some basis for comparing libraries for your own native GUI application projects.`Maybe`

, `Either`

, and `Validation`

types brings, as well as using `newtype`

to differentiate inputs. We also demonstrate the difference between `Applicative`

and `Monad`

.Reference

Each article explains a single, sometimes small, Haskell topic in detail. Some articles include video. Haskell reference pages supplement, but are independent of, the courses and projects. Haskellers of any level will find them useful as reference.

`ReaderT`

from the `transformers`

library and use it to illustrate type aliases, newtypes, and various approaches for typeclass deriving, using the `GeneralizedNewtypeDeriving`

and `DerivingVia`

GHC extensions.*primitive*,

*lifted*, and

*boxed*types.

*language extensions*, ranging from very simple syntactic extensions to very complex type drama. This article helps you understand what extensions are, how to use them, and which ones are especially useful as your first extensions.

`TypeApplications`

lets you visibly apply functions to type arguments. We demonstrate several common use cases.`ScopedTypeVariables`

lets you extend the scope of a type variable over a whole function, including its subexpressions.Transitions

Switching to Haskell doesn’t mean you have to start over learning how to code. Our *transitions* content is geared toward explaining how concepts from other languages relate to Haskell, so you can advantage of what you already know as you get started in Haskell. We focus on Java, JavaScript, and Python.

`Math.max() < Math.min()`

and what it has to do with monoids. This is a two-part article covering Haskell’s folds (compared to JavaScript `reduce`

), monoids, and identity values.`scotty`

, a Haskell web framework.Tooling

This section covers topics that aren’t about the Haskell language itself, but about software that helps you be more productive with it.

`:type`

command and never be at a loss for knowledge of types`ghcid`