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
" Gopi's _gvimrc file https://github.com/GopinathMR | |
" This file has been modified to make it work on both Windows and Linux | |
" Github gist location : https://gist.github.com/1100054 | |
" If you find any issues or add any enhancements, please submit revised version as gist | |
"---------------------------------------------------------------------------------------------------------- | |
" 1. OS specific | |
if ($OS == 'Windows_NT') | |
" Windows specific settings |
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
#! perl | |
sub on_user_command { | |
my ($self, $cmd) = @_; | |
if ($cmd eq "fullscreen:switch") { | |
my $dummy = `wmctrl -r :ACTIVE: -b toggle,fullscreen` ; | |
} | |
} |
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
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 |
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
How to add imperative programming to a pure functional language | |
=== | |
Many people bemoan languages such as Haskell for not supporting imperative | |
programming; they decry the need for math in their computer science. | |
![Math? In my computer? Yeah right.](http://i.imgur.com/YDIaEPB.jpg) | |
I'm here to tell you that not only does Haskell make imperative programming a | |
cinch, but safe and correct as well. Follow along! This post is written in |
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
--A universe in 125 lines of haskell: http://i.imgur.com/9dJdaV1.png | |
--Note: I had made a better version but that computer died :/ | |
--to build: cabal install random gloss && ghc -O3 -threaded Newtonian.hs && ./Newtonian | |
import Graphics.Gloss | |
import Graphics.Gloss.Data.Picture | |
import Graphics.Gloss.Data.Vector | |
import Graphics.Gloss.Interface.Pure.Simulate | |
import Data.List | |
import System.Random |
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
-- Hello Agda Enthusiasts! | |
-- Let's play with Agda. | |
-- Firstly, since we're editing demo1A.agda, let's name our module correctly: | |
module demo1A where -- Load the file with C-c C-l - Like that! | |
-- Syntax is highlighted by Emacs |
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 Data.List | |
import Control.Arrow | |
import System.Random | |
-- Core Life Engine | |
life = f 3 >>> map (map (q 3 >>> uncurry s)) | |
s n 1 | n < 3 = 0 -- There is no 'off-by-one' error here |
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 DeriveFunctor #-} | |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE KindSignatures #-} | |
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE TypeOperators #-} | |
import Control.Monad | |
{- |
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 Data.List (intercalate, foldl') | |
data Monom c a = M c [a] deriving (Eq) | |
newtype Polynom c a = P [Monom c a] deriving (Eq) | |
instance (Eq c, Ord a) => Ord (Monom c a) where | |
compare (M _ asl) (M _ asr) = compare asl asr | |
instance (Show a, Show c, Num a, Num c, Eq a, Eq c) => Show (Monom c a) 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
import Control.Arrow ((&&&)) | |
fib = fst . (iterate (snd &&& uncurry (+)) (0, 1) !!) |