Skip to main content

acdg_foundations 0.1.0 copy "acdg_foundations: ^0.1.0" to clipboard
acdg_foundations: ^0.1.0 copied to clipboard

Recriação fiel, em Dart puro e sem dependências, dos protocolos e tipos de valor fundamentais da stdlib do Swift: Optional, Equatable, Hashable, Comparable, Identifiable, Copyable e Escapable.

0.1.0 #

  • Versão inicial. Recriação fiel, em Dart puro e sem dependências, dos protocolos e tipos de valor fundamentais da stdlib do Swift:
    • Optional<Wrapped> (Some/None) com map, flatMap, ??, force-unwrap com trap e pattern matching.
    • Optional Binding: if let (ifLet, com cláusula where), guard let (guardLet, com else obrigado a sair do escopo via Never), escopo encadeado binding(...) com fallback, e switch nativo sobre Some/None.
    • Equatable (igualdade de valor via isEqual).
    • Hashable (Equatable + hash(into:)) com Hasher próprio.
    • Comparable (Equatable + ordem total via <), interoperável com dart:core Comparable/List.sort.
    • Identifiable + ObjectIdentifier + ReferenceIdentifiable.
    • Copyable e emulação de ~Copyable (move-only) via NonCopyable; BitwiseCopyable (marcador de tipo trivial).
    • Escapable e emulação de ~Escapable (lifetime atrelado) via NonEscapable + borrowing.
    • String Representation: CustomStringConvertible (delega toString), CustomDebugStringConvertible, LosslessStringConvertible (+ fábrica reificada) e as funções describing/reflecting (= String(describing:)/ String(reflecting:)).
    • Raw Representation: CaseIterable (allCases ≈ values) e RawRepresentable (rawValue + init?(rawValue:) reificado).
    • Cobertura completa da página "Basic Behaviors" da stdlib do Swift.
    • Encoding/Decoding/Serialization: Encodable, Decodable (reificado como fábrica), Codable, Encoder/Decoder, os 8 containers (KeyedEncodingContainer(Protocol), UnkeyedEncodingContainer, SingleValueEncodingContainer e os pares de decode), CodingKey, CodingKeyEnum, CodingKeyRepresentable, CodingUserInfoKey, EncodingError/DecodingError (com codingPath). Coders concretos JSONEncoder/JSONDecoder + JSONSerialization (writer/parser JSON escrito do zero, sem dart:convert).
    • Initialization with Literals: ExpressibleByIntegerLiteral, …FloatLiteral, …BooleanLiteral, …NilLiteral, …ArrayLiteral, …DictionaryLiteral, a hierarquia de string (…UnicodeScalarLiteral ← …ExtendedGraphemeClusterLiteral ← …StringLiteral ← …StringInterpolation), StringInterpolationProtocol/DefaultStringInterpolation, StaticBigInt e os type aliases default — todos os init(...Literal:) reificados como fábricas.
0
likes
150
points
79
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Recriação fiel, em Dart puro e sem dependências, dos protocolos e tipos de valor fundamentais da stdlib do Swift: Optional, Equatable, Hashable, Comparable, Identifiable, Copyable e Escapable.

Repository (GitHub)
View/report issues

License

BSD-3-Clause (license)

More

Packages that depend on acdg_foundations