module Data.Rope 
    ( 
    -- * Size
      Rope
    , length    -- :: Rope m -> Int
    , null      -- :: Rope m -> Bool
    -- * Splicing
    , Reducer(..)
    -- * Slicing
    , Annotation(..)
    , elide     -- :: Annotation m => Int -> Int -> Rope m -> Rope m
    , splitAt   -- :: Annotation m => Int -> Rope m -> (Rope m, Rope m)
    , take      -- :: Annotation m => Int -> Rope m -> Rope m
    , drop      -- :: Annotation m => Int -> Rope m -> Rope m
    -- * Walking
    , Unpackable(..)
    -- * Packing 'Rope'
    -- ** Polymorphic construction
    , Packable(..)
    -- ** Explicit construction
    , empty              -- :: Monoid m => Rope m
    , fromByteString     -- :: Annotation m => ByteString -> Rope m
    , fromChunks         -- :: Annotation m => [ByteString] -> Rope m
    , fromLazyByteString -- :: Annotation m => L.ByteString -> Rope m
    , fromWords          -- :: Annotation m => [Word8] -> Rope m
    , fromChar           -- :: Annotation m => Char -> Rope m
    , fromWord8          -- :: Annotation m => Word8 -> Rope m
    , fromString         -- :: Annotation m => String -> Rope m
    -- * Deconstructing 'Rope's
    , toChunks           -- :: Rope m -> [ByteString]
    , toLazyByteString   -- :: Rope m -> L.ByteString
    , toString           -- :: Rope m -> String
    ) where

import Prelude hiding (null,head,length,drop,take,splitAt, last)
import Data.Rope.Internal 
    ( Rope
    , empty
    , length
    , null
    , fromChunks
    , fromByteString
    , fromLazyByteString
    , fromWords
    , fromChar
    , fromWord8
    , fromString
    , toLazyByteString
    , Packable(..)
    , Annotation(..)
    , elide, splitAt, take, drop)
import Data.Rope.Unpackable (Unpackable(..))
import Data.Rope.Util.Reducer (Reducer(..))
import Data.ByteString (ByteString)

toString :: Rope m -> String
toString = unpack

toChunks :: Rope m -> [ByteString]
toChunks = unpack