indexJ n (Append _ l r) | n < (getSize (size (tag l))) = indexJ n l
| otherwise = indexJ (n - getSize (size (tag l))) r
+-- 2. drop
+dropJ :: (Sized b, Monoid b) =>
+ Int -> JoinList b a -> JoinList b a
+dropJ 0 x = x
+dropJ _ Empty = Empty
+dropJ _ (Single _ _) = Empty
+dropJ n x | (getSize (size (tag x))) < n = Empty
+dropJ n (Append _ l r) | n > (getSize (size (tag l))) =
+ dropJ (n - getSize (size (tag l))) r
+ | otherwise = let lft = dropJ n l in
+ Append ((tag lft) `mappend` (tag r)) lft r