# User:Duplode/wb2pdf sandbox

## Testing

First, let us try a naked pre block:

```[[1,2,3,4]]
```

And a naked parser function:

`[[1,2,3,4]]`

Then, surrounding pre it with a body note:

Note

```[[1,2,3,4]]
```

`[[1,2,3,4]]`

Example: A list with a single list

`[[1,2,3,4]]`

...what about a bare Exercises?

Exercises
`[[1,2,3,4]]`

`1,2,3,4`

`[1,2,3, 4]`

`[[1,2,3,[]]]`

## Source within box templates

Source

Note

Like monads and functors, monoids are a mathematical concept with a corresponding useful Haskell class. We will discuss them in later chapters such as Monoids and MonadPlus. This note is aimed at readers who met monoids before in other contexts; don't worry with it if you had never heard of them until now.

The left and right unit laws of monads are in analogy to the laws for the neutral element of a monoid. Furthermore, the associativity of `(>>=)` bind is analogous to the associativity of monoids; even if in the way it was written above it looks a bit different due to the lambda expression, `(\x -> f x >>= g)`. The resemblance becomes clearer with the alternative formulation as

```   (f >=> g) >=> h  =  f >=> (g >=> h)
```

where `(>=>)` is the equivalent of function composition `(.)` for monads and defined as

```   (>=>) :: Monad m => (a -> m b) -> (b -> m c) -> a -> m c
f >=> g = \x -> f x >>= g
```

pre

Note

Like monads and functors, monoids are a mathematical concept with a corresponding useful Haskell class. We will discuss them in later chapters such as Monoids and MonadPlus. This note is aimed at readers who met monoids before in other contexts; don't worry with it if you had never heard of them until now.

The left and right unit laws of monads are in analogy to the laws for the neutral element of a monoid. Furthermore, the associativity of `(>>=)` bind is analogous to the associativity of monoids; even if in the way it was written above it looks a bit different due to the lambda expression, `(\x -> f x >>= g)`. The resemblance becomes clearer with the alternative formulation as

```   (f >=> g) >=> h  =  f >=> (g >=> h)
```

where `(>=>)` is the equivalent of function composition `(.)` for monads and defined as

```   (>=>) :: Monad m => (a -> m b) -> (b -> m c) -> a -> m c
f >=> g = \x -> f x >>= g
```

Space indent

Note

Like monads and functors, monoids are a mathematical concept with a corresponding useful Haskell class. We will discuss them in later chapters such as Monoids and MonadPlus. This note is aimed at readers who met monoids before in other contexts; don't worry with it if you had never heard of them until now.

The left and right unit laws of monads are in analogy to the laws for the neutral element of a monoid. Furthermore, the associativity of `(>>=)` bind is analogous to the associativity of monoids; even if in the way it was written above it looks a bit different due to the lambda expression, `(\x -> f x >>= g)`. The resemblance becomes clearer with the alternative formulation as

```   (f >=> g) >=> h  =  f >=> (g >=> h)
```

where `(>=>)` is the equivalent of function composition `(.)` for monads and defined as

```   (>=>) :: Monad m => (a -> m b) -> (b -> m c) -> a -> m c
f >=> g = \x -> f x >>= g
```

## Nested templates

Note

xyz||abc

`xyz||abc`

# A chapter

• Haskell/Classes and types
• (tricky) implement a simple Complex data type which is an instance of Num.
• (bonus) implement a random walk simulation.
• implement isGrandparent (see the talk page).