% Title % Name % Date
List
{-# OPTIONS -Wall #-} | |
module Main where | |
import Control.Concurrent (threadDelay) | |
import System.Environment (getArgs) | |
import System.INotify | |
main :: IO () | |
main = do |
import Control.Monad | |
import Control.Applicative | |
checkProperty = undefined | |
getDmgMult t elem = maybe 1 id $ do | |
e <- elem | |
let check f = checkProperty t ((==e) . f) >>= guard | |
(check succ >> return 2) `mplus` (check pred >> return 0.5) |
-- probably broken | |
-- no polymorphic kind signatures, which may make things cleaner | |
{-# OPTIONS_GHC -Wall #-} | |
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE PolyKinds #-} | |
{-# LANGUAGE ConstraintKinds #-} | |
{-# LANGUAGE KindSignatures #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE TypeOperators#-} |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE RankNTypes #-} | |
{-# LANGUAGE StandaloneDeriving #-} | |
module RedBlackTree where | |
data Zero | |
data Succ n | |
type One = Succ Zero | |
data Black |
# Codification of discussion at http://code.google.com/p/xmonad/issues/detail?id=177 | |
# Probably better to run each of these lines one by one instead of as a shell | |
# script, since there's a high probability of `cabal install` failing (usually | |
# fixed by installing the relevant libfoo-dev package) | |
# One person said these steps did not work. | |
# My Java version is: | |
# java version "1.6.0_34" | |
# Java(TM) SE Runtime Environment (build 1.6.0_34-b04) | |
# Java HotSpot(TM) Server VM (build 20.9-b04, mixed mode) |
createUser :: Text -- ^ Username | |
-> ByteString -- ^ Password | |
-> Handler b (AuthManager b) (Either String AuthUser) | |
createUser "" _ = return $ Left "Username cannot be empty" | |
createUser unm pwd = withBackend $ \r -> do | |
u <- liftIO $ buildAuthUser r unm pwd | |
return $ Right u |
-- Demonstration of a finite deterministic state machine | |
-- The state is tracked using a single data type, which is parametrised | |
-- over the type of messages which are allowed to update the state at any | |
-- point in time. | |
-- This should be more clear when reading the code :-) | |
-- Kudos to elliott, merlijn, mm_freak and others in #haskell for all help | |
-- and pointers | |
{-# LANGUAGE DataKinds, |
13:15 <xQuasar> | HASKELL IS FOR FUCKIN FAGGOTS. YOU'RE ALL A BUNCH OF | |
| FUCKIN PUSSIES | |
13:15 <xQuasar> | JAVASCRIPT FOR LIFE FAGS | |
13:16 <luite> | hello | |
13:16 <ChongLi> | somebody has a mental illness! | |
13:16 <merijn> | Wow...I suddenly see the error of my ways and feel | |
| compelled to write Node.js! | |
13:16 <genisage> | hi | |
13:16 <luite> | you might be pleased to learn that you can compile | |
| haskell to javascript now |
Aff | |
Brav Bravo | |
Cai | |
Doy Delt Delta | |
Eck Echo | |
Fay | |
Goff | |
Hoop | |
Ish | |
Jo |