- Bigger code on lambda syntax page
- Need some stuff here (on the slide before lambda typing)
- Colours on new types page.
- Missing type param on BiFunction on streams types page.
- To vs Too on stream oprs page.
- "Thnigs" on Bad - Inconsistent API page
- Red on Bad was hard to read - Partial Application Page
- (Making up Range) on Bad Type inference
- About 30 minutes
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
With this cabal version: | |
bkolera at Ben-imac in /tmp/barebones | |
$ cabal --version | |
cabal-install version 1.20.0.1 | |
using version 1.20.0.0 of the Cabal library | |
And a cabal file looks like this: | |
Name: barebones |
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 OverloadedLists, OverloadedStrings, TupleSections #-} | |
import Prelude hiding (readFile) | |
import Control.Applicative ((<$>),(<*>)) | |
import Control.Error (Script,left,headMay,note,runScript,scriptIO) | |
import qualified Data.ByteString.Lazy as B | |
import Data.Char (isDigit) | |
import Data.Csv (FromNamedRecord,ToNamedRecord,decodeByName,encodeByName | |
,namedRecord,parseNamedRecord,toNamedRecord,(.=),(.:)) | |
import Data.Default (def) |
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
use strict; | |
use warnings; | |
=head1 NAME | |
create_dbic.pl | |
=head1 SYNOPSIS | |
perl maintenaince/create_dbic.pl --help | <options> |
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
module Main where | |
import Control.Applicative ((<$>)) | |
import Control.Monad (mfilter) | |
import Data.Char (toLower,isSpace) | |
import Data.List (dropWhileEnd,intercalate) | |
import Data.Time.Clock.POSIX | |
import Data.Version (versionBranch) | |
import Distribution.PackageDescription | |
import Distribution.PackageDescription.Parse |
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
00:34 <edwardk> spacekitteh: not in 30 seconds or less ;) | |
00:37 <edwardk> but the short version of it is that if you take a category, and look at its hom-sets C^op * C -> Set and fix its second argument, so you are looking at the space of all arrows into an object, these spaces of arrows are what we call presheaves (functors from C^op -> Set) the yoneda embedding Y : C -> [ C^op, Set ] is the functor that takes objects in C to their corresponding presheaves in this way. | |
00:38 <edwardk> why is that interesting? | |
00:39 <edwardk> well, if you look the functor category [X, Y] of functors from X to Y with natural transformations between them as your arrows then you can find that this category inherits most of its structure from Y. | |
00:40 <edwardk> [2, Set] is Set^2, its basically pairs of objects for objects, pairs of arrows for arrows, it is cartesian because Set is cartesian, it is cocartesian because set is cocartesian, etc. | |
00:40 <edwardk> that suggests that [C^op, Set] acts a lot like Set! | |
00:40 <benl23> CCC ft |
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 OverloadedStrings,TemplateHaskell #-} | |
module Main (main) where | |
import Prelude () | |
import BasePrelude | |
import Control.Lens | |
import Control.Monad.State (State,execState) | |
import Network.Wai.Handler.Warp | |
import Rest.Driver.Wai (apiToApplication) |
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
NAME=$1 | |
SANDBOX_BASE=$HOME/opt/haskell | |
SANDBOX_CONF=$SANDBOX_BASE/$NAME.sandbox.config | |
SANDBOX_DIR=$SANDBOX_BASE/$NAME | |
rm -fr $SANDBOX_DIR | |
rm -fr $SANDBOX_CONF | |
cabal --sandbox-config-file $SANDBOX_CONF sandbox init --sandbox $SANDBOX_DIR | |
cabal --sandbox-config-file $SANDBOX_CONF install $NAME | |
ln -s $SANDBOX_DIR/bin/* $HOME/bin/ |
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
share [mkPersist sqlSettings, mkMigrate "migrateAll"] [persistLowerCase| | |
Success | |
who Text List | |
what Text | |
achievements Text List | |
|] | |
-- Generates a table with a single varchar for who / achievements without any error or warning. | |
-- It just gets completely ignored... |
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
hush :: Either e a -> Maybe a | |
hush = either (const Nothing) Just | |
toId :: JObject -> Maybe Number | |
toId o = fromNumber <|> fromString | |
where | |
fromNumber = hush $ o .? "id" | |
fromString = do | |
s <- hush $ o .? "id" | |
mfilter (isNan >>> not) Just (readFloat s) |