This file contains hidden or 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
| % ghc --version | |
| The Glorious Glasgow Haskell Compilation System, version 7.10.1 | |
| % ghc -ignore-dot-ghci -e 'let f x = System.Mem.Weak.addFinalizer x (putStrLn ("bye " ++ show x)) in mapM_ f [-10..10 :: Integer] *> System.Mem.performGC *> Control.Concurrent.threadDelay 1000000' | |
| bye 10 | |
| bye 9 | |
| bye 8 | |
| bye 7 | |
| bye 6 | |
| bye 5 |
This file contains hidden or 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
| @@ @djinn @type (.) | |
| f a b c = a (b c) | |
| @@ @djinn @type (.)(.) | |
| f a b c d = a b (c d) | |
| @@ @djinn @type (.)(.)(.) | |
| f a b c d = a (b c d) | |
| @@ @djinn @type (.)(.)(.)(.) |
This file contains hidden or 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
| filter p zs = foldr (select p) [] zs where { select p x xs | p x = x:xs | otherwise = xs } | |
| filter' p zs = foldr (select p) ([],()) zs where { select p x ~(xs,_) | p x = (x:xs, ()) | otherwise = (xs, ()) } | |
| partition p zs = foldr (select p) ([],[]) zs where { select p x ~(xs,ys) | p x = (x:xs, ys) | otherwise = (xs, x:ys) } |
This file contains hidden or 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
| -- Law of Excluded Middle in Cont | |
| import Data.Void | |
| import Control.Monad.Cont | |
| type Not f a = a -> f Void | |
| type Either' r a b = (a -> r) -> (b -> r) -> r | |
| hello :: String |
This file contains hidden or 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
| -- Exercise: prove Peirce’s law <=> law of excluded middle in Haskell | |
| {-# LANGUAGE Rank2Types #-} | |
| import Data.Void | |
| type Not a = a -> Void | |
| type Peirce = forall a b. ((a -> b) -> a) -> a | |
| type LEM = forall a. Either (Not a) a |
This file contains hidden or 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
| Mar 14 02:54:27 ahdin kernel: [50128.106275] INFO: task steam.exe:20809 blocked for more than 120 seconds. | |
| Mar 14 02:54:27 ahdin kernel: [50128.106288] Tainted: P OE 3.16.0-31-generic #41~14.04.1-Ubuntu | |
| Mar 14 02:54:27 ahdin kernel: [50128.106293] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. | |
| Mar 14 02:54:27 ahdin kernel: [50128.106298] steam.exe D ffff88031fc93440 0 20809 2351 0x20020000 | |
| Mar 14 02:54:27 ahdin kernel: [50128.106308] ffff8802b6fdb8a8 0000000000200082 ffff880097a45180 ffff8802b6fdbfd8 | |
| Mar 14 02:54:27 ahdin kernel: [50128.106316] 0000000000013440 0000000000013440 ffff8802217adbb0 ffff880097a45180 | |
| Mar 14 02:54:27 ahdin kernel: [50128.106323] ffff8802c0e2b4b8 ffff8802c0e2b4d0 ffffffffc0470b62 ffffea000597ec80 | |
| Mar 14 02:54:27 ahdin kernel: [50128.106330] Call Trace: | |
| Mar 14 02:54:27 ahdin kernel: [50128.106419] [<ffffffffc0470b62>] ? xfs_vm_bmap+0x32/0xa0 [xfs] | |
| Mar 14 02:54:27 ahdin kernel: [50128.106434] [<ffffffff817675c9>] schedule+0x29 |
This file contains hidden or 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
| directory: ~/storage/media/audio/albums | |
| library: ~/storage/media/audio/albums.blb | |
| paths: | |
| default: %asciify{%the{$albumartist} - $year%if{$month,-$month%if{$day,-$day,},} - $album%aunique{}/$disc-$track - %if{$disctitle,$disctitle - ,}%the{$artist} - $title} | |
| singleton: %asciify{Non-Album/%the{$artist} - $title} | |
| comp: %asciify{Various Artists - $year%if{$month,-$month%if{$day,-$day,},} - $album%aunique{}/$disc-$track - %if{$disctitle,$disctitle - ,}%the{$artist} - $title} | |
| per_disc_numbering: yes |
This file contains hidden or 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
| (a,b) = ("foo", "bar" + 42) |
This file contains hidden or 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
| <!DOCTYPE html><html><head><title>Foo</title><style>body { font-size: 3em; }td { padding: 0.3em; text-align: right; }</style></head><body><table><tr><td><span style="color: red">0</span><span style="color: blue">1</span></td><td><span style="color: red">0</span><span style="color: blue">2</span></td><td><span style="color: red">0</span><span style="color: blue">3</span></td><td><span style="color: red">0</span><span style="color: blue">4</span></td><td><span style="color: red">0</span><span style="color: blue">5</span></td><td><span style="color: red">0</span><span style="color: blue">6</span></td><td><span style="color: red">0</span><span style="color: blue">7</span></td><td><span style="color: red">0</span><span style="color: blue">8</span></td><td><span style="color: red">0</span><span style="color: blue">9</span></td><td><span style="color: red">1</span><span style="color: blue">0</span></td></tr><tr><td><span style="color: red">1</span><span style="color: blue">1</span></td><td><span style="color: red">1 |
This file contains hidden or 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
| https://gist.github.com/ion1/4589818#file-rcon |