- Exceptions
- Delimited continuations, because continuations are cool.
- Macros (maybe)
- Attribute lookup – lenses?
- Keyword parameters
- [GHC implicit parameters][] are interesting
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://ncss.edu.au/challenge/ncss_challenge_2012.pdf> | |
class Semigroup a where | |
(<>) :: a -> a -> a | |
data Result = Team String | Draw Int | |
resultLength :: Result -> Int | |
resultLength (Team name) = length name | |
resultLength (Draw lgth) = lgth |
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
-- | Lock-step folding. | |
-- | |
-- This module presents an elegant way of executing multiple left folds | |
-- on one list using constant memory. For example, the mean can be | |
-- expressed as: | |
-- | |
-- @ | |
-- average = foldLeft $ (/) <$> sumF <*> lengthF | |
-- @ |
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 qualified Control.Exception.Lifted as Lifted | |
import Control.Monad.Trans.Control | |
-- | Set an option, run an action, then restore the option to its | |
-- previous value. | |
-- | |
-- @saveRestore get set value action@ is roughly equivalent to: | |
-- | |
-- > do orig <- get | |
-- > set value |
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
javascript: | |
var frm = window.frames[2]; | |
function next(f) { | |
setTimeout(f, 100); | |
} | |
function doClick(elem) { | |
var evt = document.createEvent("MouseEvents"); | |
evt.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); | |
elem.dispatchEvent(evt); | |
} |
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
-- | Birthday paradox calculator | |
import Control.Monad | |
import Data.Ratio | |
import System.Environment | |
import Text.Printf | |
birthday :: Fractional a => Integer -> Integer -> a | |
birthday days n = realToFrac $ 1 - inverse | |
where |
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 python | |
from argparse import ArgumentParser | |
from collections import namedtuple | |
import os | |
import requests | |
import yaml | |
TECHNIC_URL = 'https://github.com/TechnicPack/Technic/raw/master' |
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
-- | Solution for Lab 6 Exercise 2 | |
module Temperatures where | |
import Control.Applicative | |
import Control.Arrow | |
import Data.Char | |
import Text.Printf | |
type Row = [Double] |
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
--[[ | |
parallel2 - a better parallel module | |
==================================== | |
@author Lambda Fairy (https://github.com/lfairy) | |
**parallel2** is a complete rewrite of the ComputerCraft parallel API. | |
It gives you many features over the original, including: |
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 python | |
""" | |
---------------- | |
Treasure Chest | |
---------------- | |
\ ^__^ | |
\ (oo)\_______ | |
(__)\ )\/\ | |
||----w | |
OlderNewer