- Algorithm Design with Haskell
- Beginning Haskell: A Project-Based Approach
- Developing Web Apps with Haskell and Yesod
- Functional Design and Architecture
- Get Programming with Haskell
- Haskell Book
- Haskell Cookbook
- Haskell Data Analysis Cookbook
- Haskell Design Patterns
- Haskell from the Very Beginning
View chat.log
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Yan Shkurinskiy, [18/4/22 8:41 AM] | |
foo :: Int -> Int | |
foo x = map fib [0..] !! x | |
where | |
fib 0 = 1 | |
fib 1 = 1 | |
fib n = foo (n-2) + foo (n-1) | |
foo :: Int -> Int | |
foo = (map fib [0..] !!) |
View solution.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env nix-shell | |
#! nix-shell --show-trace --pure -Q -i "runghc --ghc-arg=-main-is --ghc-arg=Solution.main" -p "ghc.withPackages (pkgs: with pkgs; [ either text ])" -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/cf7475d2061ac3ada4b226571a4a1bb91420b578.tar.gz | |
-- You'll need nix to automatically download the dependencies: | |
-- `{ curl https://nixos.org/nix/install | sh ; } && . ~/.nix-profile/etc/profile.d/nix.sh` | |
{-# LANGUAGE OverloadedStrings | |
, PatternSynonyms #-} | |
import Prelude hiding (lookup) |
View default.nix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let | |
channel = with builtins; fromJSON | |
(readFile ./lock); | |
in fetchTarball { | |
url = "https://github.com/NixOS/nixpkgs-channels/archive/" + | |
"${channel.rev}.tar.gz"; | |
inherit (channel) sha256; | |
} |
View HaskellBooks.md
View Term.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import static java.lang.System.*; | |
import java.util.function.BiFunction; | |
import java.util.function.Function; | |
// Implementation of a pseudo-GADT in Java, translating the examples from | |
// http://www.cs.ox.ac.uk/ralf.hinze/publications/With.pdf | |
// The technique presented below is, in fact, just an encoding of a normal Algebraic Data Type | |
// using a variation of the visitor pattern + the application of the Yoneda lemma to make it | |
// isomorphic to the targeted 'GADT'. |
View layout0.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"keymap": [ | |
{ | |
"keyCode": 30, | |
"label": "1", | |
"extraLabel": "!" | |
}, | |
{ | |
"keyCode": 31, | |
"label": "2", |
View layout0.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"keymap": [ | |
{ | |
"keyCode": 2079, | |
"label": "@" | |
}, | |
{ | |
"keyCode": 2078, | |
"label": "!" | |
}, |
View constraints.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE TypeOperators #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE ConstraintKinds #-} | |
{-# LANGUAGE PolyKinds #-} | |
import Data.Kind (Constraint) | |
type family All (c :: k -> Constraint) ts :: Constraint where All c '[] = (); All c (t:ts) = (c t, All c ts) |
View hello_world.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE KindSignatures #-} | |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE TypeApplications #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE OverloadedLabels #-} | |
{-# LANGUAGE BlockArguments #-} | |
{-# LANGUAGE UnicodeSyntax #-} |
View even.ml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type _ num = | |
| Zero : zero num | |
| Succ : ('a num) -> 'a plus num | |
and _ plus = Plus : 'a num -> 'a plus | |
and zero = [ ] | |
;; | |
type _ even = | |
| Even_0 : zero num even | |
| Even_S : 'a num odd -> 'a plus num even | |
and _ odd = |
NewerOlder