bitemyapp / learnhaskell

Learn Haskell

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Some guide on how to read types

Blaisorblade opened this issue · comments

(Continuing from https://twitter.com/bitemyapp/status/543557386149969920).

Should anybody be able to help, it would be cool to get in here (a link to) some good guide on how to read types — I don't mean the syntax of types; I mean reading them to the point they're sufficient documentation (for libraries where that makes sense) — see Twitter thread above.

@bitemyapp wrote:

I've got some odds and ends. If you don't mind a sparse mess, I can point you to them.

Sounds like those should not be in the guide yet, but maybe they can be added here, to help anybody who'd like to solve the issue.

Some of what I was going to link you is in the guide, but here's one to get the ball rolling:

http://bitemyapp.com/posts/2014-11-19-update-map-in-haskell.html

I would emphasize that reasoning from types is a skill, not a fact you understand from having it recounted to you. Doing the exercises in cis194 and the NICTA course as the guide recommends is the best way I know to begin building that skill.

It doesn't come through clearly in the exercises alone (NICTA course was designed to be done in the presence of an instructor), but you're supposed to continually refine your answers as you go.

A goal to aspire to could be: Understand Choice as it exists in profunctors at the haddock docs from the types. You're not expected to understand applications of it, just understand what the types are telling you alone. Programmers often confuse the two.

Now if you're talking about reading the types lexically, that's basics that requires going through beginner material like cis194. I admit there aren't the best integrated resources for this, but something could be found for explaining (->) possibly. Some of that is already in the dialogues.