Test post using Pandoc and HScolour

This is a test post using Pandoc and HScolour to syntax highlight some Haskell code and convert it to html. It looks as follows:

> fibs :: [Int]
> fibs = 0 : 1 : (zipWith (+) fibs (tail fibs))
>
> primes = sieve [2..]
> sieve (p:xs) = p : (filter (\x-> (x `mod` p)>0) (sieve xs))
> 
> pascal :: [[Int]]
> pascal = iterate (\xs-> zipWith (+) (0:xs) (xs++[0])) [1]
>
> sieve' xs = foldr (\a b -> (a: (filter (\x-> (x `mod` a)>0) b))) [] xs
> primes' = sieve' [2..]
>
> f= ((.).(.)) (\x->x^2) (\x y -> x+y)
> fibs' n = g n 0 1
>   where
>     g 1 a b = b
>     g n a b = g (n-1) b (a+b)

You can also add some latex:


Hp(ℳFG ; ωq) ⇒ πp + q(𝕊)

Nice.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s