mirror of
https://github.com/carp-lang/Carp.git
synced 2024-11-05 04:44:12 +03:00
34 lines
684 B
Plaintext
34 lines
684 B
Plaintext
(defmodule Unit
|
|
(implements prn prn)
|
|
(sig prn (Fn [Unit] String))
|
|
(defn prn [unit]
|
|
@"()")
|
|
|
|
(doc copy
|
|
"'copies' a reference to a Unit value."
|
|
"This function just returns a fresh value of type Unit.")
|
|
(implements copy copy)
|
|
(sig copy (Fn [(Ref Unit)] Unit))
|
|
(defn copy [unit-ref]
|
|
())
|
|
|
|
(doc zero
|
|
"Returns a fresh value of type Unit (this value performs no side-effects).")
|
|
(implements zero zero)
|
|
(sig zero (Fn [] Unit))
|
|
(defn zero []
|
|
())
|
|
|
|
(implements = =)
|
|
(sig = (Fn [Unit Unit] Bool))
|
|
(defn = [unit-a unit-b]
|
|
true)
|
|
)
|
|
|
|
(defmodule UnitRef
|
|
(implements = =)
|
|
(sig = (Fn [&Unit &Unit] Bool))
|
|
(defn = [unit-a unit-b]
|
|
true)
|
|
)
|