Title here
Summary here
PureScript has various value types including strings, integers, floats, booleans, etc. Here are a few basic examples.
To run this program, save it as Values.purs
and use the PureScript compiler and runtime:
In this PureScript example:
Main
.Prelude
for basic operations, Effect
for handling side effects, and Effect.Console
for logging to the console.main
function is defined as an Effect Unit
, which is similar to IO ()
in Haskell.<>
operator instead of +
.show
to convert values to strings for logging.log
function is used instead of fmt.Println
for console output.PureScript, being a strongly-typed functional language, has some differences from imperative languages:
<>
for string concatenation instead of +
.log
return an Effect
, which represents side effects.This example demonstrates basic value types and operations in PureScript, showing how it handles strings, numbers, and booleans in a functional programming context.