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
f1 z = z + 1 | |
f2 z = z + 2 | |
f3 z = z + 3 | |
f4 z = z + 4 | |
g f = f 1 | |
-- g f1 = 2 | |
[f1 1, f2 1, f3 1, f4 1] | |
-- [2,3,4,5] : [number] |
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
main : Element | |
main = cube | |
cube = flow down tiles | |
f x = color grey (container 30 30 middle (plainText x)) | |
g x = flow right (map f x) | |
tiles = map g |
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
main : Element | |
main = cube | |
cube = flow down [ row1, row2, row3, row4 ] | |
row1 = flow right [ | |
color grey (container 30 30 middle (plainText "A")) | |
, color grey (container 30 30 middle (plainText "")) |
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
f x y = [x] ++ y | |
--<function> : a -> [a] -> [a] | |
g y = (\x -> f x y) | |
--<function> : [a] -> a -> [a] | |
items = [1,2,3] | |
--[1,2,3] : [number] | |
g items | |
--<function> : number -> [number] | |
g items 5 |
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
sum [2,3,4] | |
product [2,3,4] |
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
-- http://hackage.haskell.org/package/pipes-text-0.0.0.12/docs/Pipes-Text-IO.html | |
-- http://hackage.haskell.org/package/pipes | |
-- http://hackage.haskell.org/package/pipes-text | |
import Pipes | |
import qualified Pipes.Text as Text | |
import qualified Pipes.Text.IO as Text | |
import System.IO | |
-- http://stackoverflow.com/questions/19521246/what-does-mean-do-in-haskell |
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
wget -O http://jaspervdj.be/blaze | blaze-from-html -v html4-transitional | |
#OR | |
curl -S http://jaspervdj.be/blaze | blaze-from-html -v html4-transitional |
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
-- variant of tutorial | |
-- type "./notes" in terminal | |
{-# LANGUAGE OverloadedStrings #-} | |
import Control.Monad (forM_) | |
import Text.Blaze.Html5 | |
import Text.Blaze.Html5.Attributes | |
import qualified Text.Blaze.Html5 as H | |
import qualified Text.Blaze.Html5.Attributes as A |
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
<html> | |
<head> | |
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script> | |
</head> | |
<body> | |
<svg id="board" width=500 height=500></svg> |