Skip to main content
Last updated

String operators

length

pact
(length s)
pact
(length s)
  • takes s: string
  • produces integer

String length

Supported in either invariants or properties.

+

pact
(+ s t)
pact
(+ s t)
  • takes s: string
  • takes t: string
  • produces string
pact
(+ s t)
pact
(+ s t)
  • takes s: [a]
  • takes t: [a]
  • produces [a]

String / list concatenation

Supported in either invariants or properties.

str-to-int

pact
(str-to-int s)
pact
(str-to-int s)
  • takes s: string
  • produces integer
pact
(str-to-int b s)
pact
(str-to-int b s)
  • takes b: integer
  • takes s: string
  • produces integer

String to integer conversion

Supported in either invariants or properties.

take

pact
(take n s)
pact
(take n s)
  • takes n: integer
  • takes s: string
  • produces string

take the first n values from xs (taken from the end if n is negative)

Supported in either invariants or properties.

drop

pact
(drop n s)
pact
(drop n s)
  • takes n: integer
  • takes s: string
  • produces string

drop the first n values from xs (dropped from the end if n is negative)

Supported in either invariants or properties.

hash

pact
(hash s)
pact
(hash s)
  • takes s: string
  • produces string

BLAKE2b 256-bit hash of string values

Supported in properties only.

hash

pact
(hash s)
pact
(hash s)
  • takes s: a
  • produces string
  • where a is of type integer or decimal

BLAKE2b 256-bit hash of numerical values

Supported in properties only.