Skip to content

Commit

Permalink
Use syntax highlighting in README
Browse files Browse the repository at this point in the history
  • Loading branch information
sol committed Jun 23, 2012
1 parent 0b6350a commit 816d235
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,23 @@ Below is a small Haskell module.
The module contains a Haddock comment with some examples of interaction.
The examples demonstrate how the module is supposed to be used.

module Fib where

-- | Compute Fibonacci numbers
--
-- Examples:
--
-- >>> fib 10
-- 55
--
-- >>> fib 5
-- 5
fib :: Int -> Int
fib 0 = 0
fib 1 = 1
fib n = fib (n - 1) + fib (n - 2)
```haskell
module Fib where

-- | Compute Fibonacci numbers
--
-- Examples:
--
-- >>> fib 10
-- 55
--
-- >>> fib 5
-- 5
fib :: Int -> Int
fib 0 = 0
fib 1 = 1
fib n = fib (n - 1) + fib (n - 2)
```

(A comment line starting with `>>>` denotes an _expression_.
All comment lines following an expression denote the _result_ of that expression.
Expand Down

0 comments on commit 816d235

Please sign in to comment.