> For the complete documentation index, see [llms.txt](https://gessadavide.gitbook.io/yallo-lang/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gessadavide.gitbook.io/yallo-lang/docs/control-flow.md).

# Control flow

## If then else

```
if (a = 12n) then (15) else (12)
```

## Pattern matching

```ocaml
match a with | 12 -> true | _ -> false
```

```ocaml
type a = enum (Hello | World | No);
const b = match a#Hello with | a#Hello -> true | a#World -> false;
const c = match 2 with | 1 -> a#Hello | 2 -> a#World | _ -> a#No;

const as = Some(12);
const d = match as.isSome() with | true -> as.getSome() | false -> 13;
```
