Skip to content

Commit 1cad691

Browse files
Improves documentation regarding how to use holes in terms
1 parent 4b9637e commit 1cad691

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

docs/mkDocs/docs/options.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -739,6 +739,21 @@ an import of a module coming from package `PACKAGE`. e.g.
739739

740740
LiquidHaskell can be configured to emit warnings whenever it encounters incomplete terms, known as *holes*.
741741

742+
To create a hole you need to have a binding with the name `hole` in the scope by adding:
743+
744+
hole = undefined
745+
746+
To use a hole you simply insert the `hole` in any place
747+
where you want to get more type information. For example:
748+
```haskell
749+
hole = undefined
750+
751+
{-@ listLength :: xs:[a] -> {v : Nat | v == len xs} @-}
752+
listLength :: [a] -> Int
753+
listLength [] = hole -- Hole inserted here
754+
listLength (_:xs) = 1 + listLength xs
755+
```
756+
742757
This flag is particularly useful during development, ensuring that any placeholders in your specifications are reviewed and completed before final evaluation.
743758

744759
To activate this behavior, use the `--warn-on-term-holes` flag either:

0 commit comments

Comments
 (0)