Skip to content

Instantly share code, notes, and snippets.

This is my recommended path for learning Haskell.

Something to keep in mind: don't sweat the stuff you don't understand immediately. Just keep moving.

Primary course

Installing Haskell

Ubuntu PPA

-- scratch work and implementations for http://www.seas.upenn.edu/~cis194/lectures/01-intro.html
-- exercises: http://www.seas.upenn.edu/~cis194/hw/01-intro.pdf
intLen :: Integer -> Integer
intLen n
| (abs n) < 10 = 1
| otherwise = intLen (n `div` 10) + 1
-- Exercise 1
-- "toDigits should convert positive Integers to a list of digits"
@zeeman
zeeman / c-py-hs.md
Last active January 1, 2016 11:29
A small chrestomathy comparing C and Python with Haskell.

Comparing C and Haskell

Quick comparison

Basic expressions

C Python Haskell
2+3*(7/4) 2+3*(7/4) 2+3*(7/4)
a + 1 a + 1 succ a
@zeeman
zeeman / emmet
Last active December 22, 2015 11:58
html:5>div.container>div.class.jumbotron>div.class.container>h1+p+p>a^^^div.row>div.col-lg-6*2>h2+p^^div.row>div.col-lg-4*3>h3+p
from rest_framework import filters
class SearchFieldFilter(filters.BaseFilterBackend):
"""Filter based on record attributes."""
def filter_queryset(self, request, queryset, view):
ALLOWED_ENDINGS = ('__exact', '__iexact', '__contains', '__icontains',
'__gt', '__gte', '__lt', '__lte', '__startswith',
'__istartswith', '__endswith', '__iendswith', '__isnull',
'__search',)