Skip to content

Instantly share code, notes, and snippets.

View ferologics's full-sized avatar
🔥
🔆 〰️ 🌑

Fero ferologics

🔥
🔆 〰️ 🌑
View GitHub Profile

Value Subtypes and Generalized Enums, a manifesto

The goal of this document is to provide a comprehensive view of what value subtyping might look like in Swift and demonstrate how generalized enums play a significant role in this future.

Note: All syntax used in this document that is not currently valid Swift syntax is only intended to serve the purpose of demonstrating ideas and to serve as a point of reference for future proposals. The intent is not to propose that this exact syntax be used.

Acknowledgement: some of the ideas in this document have been inspired by Niko Matsakis' blog post exploring similar ideas in the context of Rust: http://smallcultfollowing.com/babysteps/blog/2015/08/20/virtual-structs-part-3-bringing-enums-and-structs-together/

Definition

@ferologics
ferologics / Animation.elm
Last active April 2, 2021 17:20
Elm Native UI <-> Lottie
module Animation
exposing
( view
, style
, source
, progress
)
import NativeUi as NativeUi exposing (Property, Node)
import NativeUi.Style as Style