Carp/core/Unit.carp
2020-11-24 19:31:53 +01:00

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)
)