Skip to content

Commit

Permalink
feat: Fix code in doc
Browse files Browse the repository at this point in the history
  • Loading branch information
cheleb committed Oct 6, 2024
1 parent 8a816d0 commit 9e8dd47
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions examples/client/src/main/scala/samples/OpaqueType.scala
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,19 @@ val opaque = {
}
),
"""
|opaque type Password = String
|object Password:
| def apply(password: String): Password = password
| given Form[Password] = secretForm(apply)
|
|// In another file...
|
|case class Person(
| name: String,
| weight: Int,
| hairsCount: BigInt :| GreaterEqual[100000],
| kind: Boolean = true)
| name: String,
| password: Password
| )
|
|val simpleVar = Var(Person("Vlad", 66, BigInt(100000).refineUnsafe))
|val simpleVar = Var(Person("Vlad", Password("123456"))
|
|simpleVar.asForm
""".stripMargin
Expand Down

0 comments on commit 9e8dd47

Please sign in to comment.