family/
lib.rs

1//! I can't believe it's not HKT!
2//!
3//! A small family pattern implementation, implementing "associated type constructors".
4//! Additionally provides some dynamic casting utilities that make use of families and members.
5//!
6//! See this post for more information:
7//! <http://smallcultfollowing.com/babysteps/blog/2016/11/03/associated-type-constructors-part-2-family-traits/>
8
9use std::any::Any;
10
11pub mod any;
12pub mod utils;
13
14pub use family_derive::Member;
15
16/// Family pattern family interface.
17pub trait Family: Any + Sized {
18    type Member<'a>: Member<Self>;
19}
20
21/// Family pattern member interface.
22pub trait Member<F>
23where
24    F: Family,
25{
26}