show / read
Value ↔ text conversion.
Syntax
show value // read "25" :: Int
Description
show converts a value to a String. read converts text to a number; you must specify the type for the result (:: Int).
Example
Loading editor…
Expected output
30 42!
When to use?
Conversion between text and numbers.
Common mistakes
- ⚠️ Specify the type for read's result: read "25" :: Int.