Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions docs/examples/polymorphism.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
sidebar_position: 2
---

import { Hidden } from "@site/src/components/Hidden";

# Polymorphism

_By Kaz, July 2023

## Types

What is the type of `f`?

```sml
fun f ([],[]) = f ([],[]) ^ "A"
| f (_,_) = f (_,_) ^ "A"
```

<Hidden>
Type: <code>('a list * 'b list) -> string</code> <br />

For a surprise, try putting the above function in the REPL!
</Hidden>