Deque

Double-ended Queue

This module provides a purely-functional double-ended queue.

Deque

type Deque<T> = (List<T>, List<T>)

empty

func empty<T>() : Deque<T>

isEmpty

func isEmpty<T>(q : Deque<T>) : Bool

pushFront

func pushFront<T>(q : Deque<T>, x : T) : Deque<T>

peekFront

func peekFront<T>(q : Deque<T>) : ?T

popFront

func popFront<T>(q : Deque<T>) : Deque<T>

pushBack

func pushBack<T>(q : Deque<T>, x : T) : Deque<T>

peekBack

func peekBack<T>(q : Deque<T>) : ?T

popBack

func popBack<T>(q : Deque<T>) : Deque<T>