@mikuroxina/mini-fn
    Preparing search index...

    Interface Generic<F>

    Representation translator between Instance<F> and its associated Rep type.

    All of implementations must satisfy the following laws:

    • Left identity: for all x; to(from(x)) equals to x.
    • Right identity: for all m; from(to(m)) equals to m.
    interface Generic<F> {
        from: <P>(data: Instance<F>) => Generic.GetRep<F, P>;
        to: <P>(rep: Generic.GetRep<F, P>) => Instance<F>;
    }

    Type Parameters

    • F
    Index

    Properties

    Properties

    from: <P>(data: Instance<F>) => Generic.GetRep<F, P>

    Converts data into the meta representation.

    Type Declaration

    to: <P>(rep: Generic.GetRep<F, P>) => Instance<F>

    Converts rep into the concrete data.

    Type Declaration

    rep - To be converted.