9 | data BatchedQueue a = BQ (List a) (List a)
11 | check : List a -> List a -> BatchedQueue a
12 | check [] r = BQ (reverse r) []
17 | Queue BatchedQueue where
19 | isEmpty (BQ f r) = isNil f
21 | snoc (BQ f r) x = check f (x :: r)
23 | head (BQ [] _) = idris_crash "empty queue"
24 | head (BQ (x :: f) r) = x
26 | tail (BQ [] _) = idris_crash "empty queue"
27 | tail (BQ (x :: f) r) = check f r