PreviousUpNext

15.3.466  src/lib/std/src/catlist.api

#
# Constant time concatenable list.  
#
# -- Allen Leung

# Compiled by:
#     src/lib/std/src/standard-core.sublib



#            "Just writing code is no great trick.
#             Any fool can do that, and distressingly many do.
#             The real trick is turning out good code on time."



api Catlist {

    Catlist(X);

    empty:     Catlist(X);
    null:      Catlist(X) -> Bool;
    length:    Catlist(X) -> Int;
    cons:      (X, Catlist(X)) -> Catlist(X);
    single:     X -> Catlist(X);
    append:    (Catlist(X), Catlist(X)) -> Catlist(X);
    head:      Catlist(X) -> X;
    tail:      Catlist(X) -> Catlist(X);

    from_list:  List(X) -> Catlist(X);
    to_list:    Catlist(X) -> List(X);

    map:    (X -> Y) -> Catlist(X) -> Catlist(Y);
    apply:    (X -> Void) -> Catlist(X) -> Void;
};



Comments and suggestions to: bugs@mythryl.org

PreviousUpNext