Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion lib/src/unit.dart
Original file line number Diff line number Diff line change
@@ -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;
Expand Down