Skip to content

Commit

Permalink
Added section "Getting a Id Something from a UUID"
Browse files Browse the repository at this point in the history
  • Loading branch information
mpscholten authored Aug 24, 2020
1 parent 520e87d commit 8d2ee51
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Guide/recipes.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,18 @@ export IHP_BROWSER=echo
```

This will then just print out the url which would be opened on start.

## Getting a `Id Something` from a `UUID`

Sometimes you have a UUID value which represents some record id. To get the types right, you can transform it like this:

```haskell
let myUUID = ...
let projectId = (Id myUUID) :: Id Project
```

In case the id is hardcoded, you can just type UUID value with the right type signature like this:

```haskell
let projectId = "ca63aace-af4b-4e6c-bcfa-76ca061dbdc6" :: Id Project
```

0 comments on commit 8d2ee51

Please sign in to comment.