3 -- Type class for data structures that can represent the text buffer
8 -- | Convert a buffer to a String.
9 toString :: b -> String
11 -- | Create a buffer from a String.
12 fromString :: String -> b
14 -- | Extract the nth line (0-indexed) from a buffer. Return Nothing
15 -- for out-of-bounds indices.
16 line :: Int -> b -> Maybe String
18 -- | @replaceLine n ln buf@ returns a modified version of @buf@,
19 -- with the @n@th line replaced by @ln@. If the index is
20 -- out-of-bounds, the buffer should be returned unmodified.
21 replaceLine :: Int -> String -> b -> b
23 -- | Compute the number of lines in the buffer.
26 -- | Compute the value of the buffer, i.e. the amount someone would
27 -- be paid for publishing the contents of the buffer.