diff --git a/lib/src/unit.dart b/lib/src/unit.dart index 2460d70..59d1972 100644 --- a/lib/src/unit.dart +++ b/lib/src/unit.dart @@ -1,4 +1,20 @@ -// ignore_for_file: unnecessary_new +/// Represents a Unit type (a type with only one value). +/// +/// In functional programming, Unit is used when a function +/// needs to return a value, but the actual value is not important. +/// +/// It is similar to `void`, but unlike `void`, it is a proper type +/// and can be used in expressions. +/// +/// Example: +/// ```dart +/// final u = unit; +/// print(u); // () +/// ``` +/// +/// This is useful in cases where you want to indicate that +/// a computation has completed but does not return meaningful data. +/// // ignore_for_file: unnecessary_new // ignore_for_file: unnecessary_const part of dartz;