packages feed

brick 0.71.1 → 0.72

raw patch · 6 files changed

+81/−64 lines, 6 filesdep ~text-zipperPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: text-zipper

API changes (from Hackage documentation)

- Brick.BorderMap: eBottomL :: forall a_acLd. Lens' (Edges a_acLd) a_acLd
+ Brick.BorderMap: eBottomL :: forall a_acLe. Lens' (Edges a_acLe) a_acLe
- Brick.BorderMap: eLeftL :: forall a_acLd. Lens' (Edges a_acLd) a_acLd
+ Brick.BorderMap: eLeftL :: forall a_acLe. Lens' (Edges a_acLe) a_acLe
- Brick.BorderMap: eRightL :: forall a_acLd. Lens' (Edges a_acLd) a_acLd
+ Brick.BorderMap: eRightL :: forall a_acLe. Lens' (Edges a_acLe) a_acLe
- Brick.BorderMap: eTopL :: forall a_acLd. Lens' (Edges a_acLd) a_acLd
+ Brick.BorderMap: eTopL :: forall a_acLe. Lens' (Edges a_acLe) a_acLe
- Brick.Types: availHeightL :: forall n_awEp. Lens' (Context n_awEp) Int
+ Brick.Types: availHeightL :: forall n_awEq. Lens' (Context n_awEq) Int
- Brick.Types: availWidthL :: forall n_awEp. Lens' (Context n_awEp) Int
+ Brick.Types: availWidthL :: forall n_awEq. Lens' (Context n_awEq) Int
- Brick.Types: bordersL :: forall n_awEt. Lens' (Result n_awEt) (BorderMap DynBorder)
+ Brick.Types: bordersL :: forall n_awEu. Lens' (Result n_awEu) (BorderMap DynBorder)
- Brick.Types: ctxAttrMapL :: forall n_awEp. Lens' (Context n_awEp) AttrMap
+ Brick.Types: ctxAttrMapL :: forall n_awEq. Lens' (Context n_awEq) AttrMap
- Brick.Types: ctxAttrNameL :: forall n_awEp. Lens' (Context n_awEp) AttrName
+ Brick.Types: ctxAttrNameL :: forall n_awEq. Lens' (Context n_awEq) AttrName
- Brick.Types: ctxBorderStyleL :: forall n_awEp. Lens' (Context n_awEp) BorderStyle
+ Brick.Types: ctxBorderStyleL :: forall n_awEq. Lens' (Context n_awEq) BorderStyle
- Brick.Types: ctxDynBordersL :: forall n_awEp. Lens' (Context n_awEp) Bool
+ Brick.Types: ctxDynBordersL :: forall n_awEq. Lens' (Context n_awEq) Bool
- Brick.Types: ctxHScrollBarOrientationL :: forall n_awEp. Lens' (Context n_awEp) (Maybe HScrollBarOrientation)
+ Brick.Types: ctxHScrollBarOrientationL :: forall n_awEq. Lens' (Context n_awEq) (Maybe HScrollBarOrientation)
- Brick.Types: ctxHScrollBarRendererL :: forall n_awEp. Lens' (Context n_awEp) (Maybe (ScrollbarRenderer n_awEp))
+ Brick.Types: ctxHScrollBarRendererL :: forall n_awEq. Lens' (Context n_awEq) (Maybe (ScrollbarRenderer n_awEq))
- Brick.Types: ctxVScrollBarOrientationL :: forall n_awEp. Lens' (Context n_awEp) (Maybe VScrollBarOrientation)
+ Brick.Types: ctxVScrollBarOrientationL :: forall n_awEq. Lens' (Context n_awEq) (Maybe VScrollBarOrientation)
- Brick.Types: ctxVScrollBarRendererL :: forall n_awEp. Lens' (Context n_awEp) (Maybe (ScrollbarRenderer n_awEp))
+ Brick.Types: ctxVScrollBarRendererL :: forall n_awEq. Lens' (Context n_awEq) (Maybe (ScrollbarRenderer n_awEq))
- Brick.Types: cursorLocationL :: forall n_awEu. Lens' (CursorLocation n_awEu) Location
+ Brick.Types: cursorLocationL :: forall n_awEv. Lens' (CursorLocation n_awEv) Location
- Brick.Types: cursorLocationNameL :: forall n_awEu n_ayOC. Lens (CursorLocation n_awEu) (CursorLocation n_ayOC) (Maybe n_awEu) (Maybe n_ayOC)
+ Brick.Types: cursorLocationNameL :: forall n_awEv n_ayOD. Lens (CursorLocation n_awEv) (CursorLocation n_ayOD) (Maybe n_awEv) (Maybe n_ayOD)
- Brick.Types: cursorsL :: forall n_awEt. Lens' (Result n_awEt) [CursorLocation n_awEt]
+ Brick.Types: cursorsL :: forall n_awEu. Lens' (Result n_awEu) [CursorLocation n_awEu]
- Brick.Types: eBottomL :: forall a_acLd. Lens' (Edges a_acLd) a_acLd
+ Brick.Types: eBottomL :: forall a_acLe. Lens' (Edges a_acLe) a_acLe
- Brick.Types: eLeftL :: forall a_acLd. Lens' (Edges a_acLd) a_acLd
+ Brick.Types: eLeftL :: forall a_acLe. Lens' (Edges a_acLe) a_acLe
- Brick.Types: eRightL :: forall a_acLd. Lens' (Edges a_acLd) a_acLd
+ Brick.Types: eRightL :: forall a_acLe. Lens' (Edges a_acLe) a_acLe
- Brick.Types: eTopL :: forall a_acLd. Lens' (Edges a_acLd) a_acLd
+ Brick.Types: eTopL :: forall a_acLe. Lens' (Edges a_acLe) a_acLe
- Brick.Types: extentsL :: forall n_awEt. Lens' (Result n_awEt) [Extent n_awEt]
+ Brick.Types: extentsL :: forall n_awEu. Lens' (Result n_awEu) [Extent n_awEu]
- Brick.Types: imageL :: forall n_awEt. Lens' (Result n_awEt) Image
+ Brick.Types: imageL :: forall n_awEu. Lens' (Result n_awEu) Image
- Brick.Types: visibilityRequestsL :: forall n_awEt. Lens' (Result n_awEt) [VisibilityRequest]
+ Brick.Types: visibilityRequestsL :: forall n_awEu. Lens' (Result n_awEu) [VisibilityRequest]
- Brick.Types: windowHeightL :: forall n_awEp. Lens' (Context n_awEp) Int
+ Brick.Types: windowHeightL :: forall n_awEq. Lens' (Context n_awEq) Int
- Brick.Types: windowWidthL :: forall n_awEp. Lens' (Context n_awEp) Int
+ Brick.Types: windowWidthL :: forall n_awEq. Lens' (Context n_awEq) Int
- Brick.Widgets.Dialog: dialogButtonsL :: forall a_a1fNW a_a1fOA. Lens (Dialog a_a1fNW) (Dialog a_a1fOA) [(String, a_a1fNW)] [(String, a_a1fOA)]
+ Brick.Widgets.Dialog: dialogButtonsL :: forall a_a1fS6 a_a1fSK. Lens (Dialog a_a1fS6) (Dialog a_a1fSK) [(String, a_a1fS6)] [(String, a_a1fSK)]
- Brick.Widgets.Dialog: dialogSelectedIndexL :: forall a_a1fNW. Lens' (Dialog a_a1fNW) (Maybe Int)
+ Brick.Widgets.Dialog: dialogSelectedIndexL :: forall a_a1fS6. Lens' (Dialog a_a1fS6) (Maybe Int)
- Brick.Widgets.Dialog: dialogTitleL :: forall a_a1fNW. Lens' (Dialog a_a1fNW) (Maybe String)
+ Brick.Widgets.Dialog: dialogTitleL :: forall a_a1fS6. Lens' (Dialog a_a1fS6) (Maybe String)
- Brick.Widgets.Dialog: dialogWidthL :: forall a_a1fNW. Lens' (Dialog a_a1fNW) Int
+ Brick.Widgets.Dialog: dialogWidthL :: forall a_a1fS6. Lens' (Dialog a_a1fS6) Int
- Brick.Widgets.Edit: editContentsL :: forall t_a19Y8 n_a19Y9 t_a19YN. Lens (Editor t_a19Y8 n_a19Y9) (Editor t_a19YN n_a19Y9) (TextZipper t_a19Y8) (TextZipper t_a19YN)
+ Brick.Widgets.Edit: editContentsL :: forall t_a19Y9 n_a19Ya t_a19YO. Lens (Editor t_a19Y9 n_a19Ya) (Editor t_a19YO n_a19Ya) (TextZipper t_a19Y9) (TextZipper t_a19YO)
- Brick.Widgets.Edit: handleEditorEvent :: (DecodeUtf8 t, Eq t, GenericTextZipper t) => Event -> Editor t n -> EventM n (Editor t n)
+ Brick.Widgets.Edit: handleEditorEvent :: (Eq n, DecodeUtf8 t, Eq t, GenericTextZipper t) => BrickEvent n e -> Editor t n -> EventM n (Editor t n)
- Brick.Widgets.FileBrowser: fileBrowserEntriesG :: forall n_a1q8z. SimpleGetter (FileBrowser n_a1q8z) (List n_a1q8z FileInfo)
+ Brick.Widgets.FileBrowser: fileBrowserEntriesG :: forall n_a1qcJ. SimpleGetter (FileBrowser n_a1qcJ) (List n_a1qcJ FileInfo)
- Brick.Widgets.FileBrowser: fileBrowserEntryFilterG :: forall n_a1q8z. SimpleGetter (FileBrowser n_a1q8z) (Maybe (FileInfo -> Bool))
+ Brick.Widgets.FileBrowser: fileBrowserEntryFilterG :: forall n_a1qcJ. SimpleGetter (FileBrowser n_a1qcJ) (Maybe (FileInfo -> Bool))
- Brick.Widgets.FileBrowser: fileBrowserExceptionG :: forall n_a1q8z. SimpleGetter (FileBrowser n_a1q8z) (Maybe IOException)
+ Brick.Widgets.FileBrowser: fileBrowserExceptionG :: forall n_a1qcJ. SimpleGetter (FileBrowser n_a1qcJ) (Maybe IOException)
- Brick.Widgets.FileBrowser: fileBrowserLatestResultsG :: forall n_a1q8z. SimpleGetter (FileBrowser n_a1q8z) [FileInfo]
+ Brick.Widgets.FileBrowser: fileBrowserLatestResultsG :: forall n_a1qcJ. SimpleGetter (FileBrowser n_a1qcJ) [FileInfo]
- Brick.Widgets.FileBrowser: fileBrowserNameG :: forall n_a1q8z. SimpleGetter (FileBrowser n_a1q8z) n_a1q8z
+ Brick.Widgets.FileBrowser: fileBrowserNameG :: forall n_a1qcJ. SimpleGetter (FileBrowser n_a1qcJ) n_a1qcJ
- Brick.Widgets.FileBrowser: fileBrowserSearchStringG :: forall n_a1q8z. SimpleGetter (FileBrowser n_a1q8z) (Maybe Text)
+ Brick.Widgets.FileBrowser: fileBrowserSearchStringG :: forall n_a1qcJ. SimpleGetter (FileBrowser n_a1qcJ) (Maybe Text)
- Brick.Widgets.FileBrowser: fileBrowserSelectableG :: forall n_a1q8z. SimpleGetter (FileBrowser n_a1q8z) (FileInfo -> Bool)
+ Brick.Widgets.FileBrowser: fileBrowserSelectableG :: forall n_a1qcJ. SimpleGetter (FileBrowser n_a1qcJ) (FileInfo -> Bool)
- Brick.Widgets.FileBrowser: fileBrowserSelectableL :: forall n_a1q8z. Lens' (FileBrowser n_a1q8z) (FileInfo -> Bool)
+ Brick.Widgets.FileBrowser: fileBrowserSelectableL :: forall n_a1qcJ. Lens' (FileBrowser n_a1qcJ) (FileInfo -> Bool)
- Brick.Widgets.FileBrowser: fileBrowserSelectedFilesG :: forall n_a1q8z. SimpleGetter (FileBrowser n_a1q8z) (Set String)
+ Brick.Widgets.FileBrowser: fileBrowserSelectedFilesG :: forall n_a1qcJ. SimpleGetter (FileBrowser n_a1qcJ) (Set String)
- Brick.Widgets.FileBrowser: fileBrowserWorkingDirectoryG :: forall n_a1q8z. SimpleGetter (FileBrowser n_a1q8z) FilePath
+ Brick.Widgets.FileBrowser: fileBrowserWorkingDirectoryG :: forall n_a1qcJ. SimpleGetter (FileBrowser n_a1qcJ) FilePath
- Brick.Widgets.List: listElementsL :: forall n_a1kWH t_a1kWI e_a1kWJ t_a1laN e_a1laO. Lens (GenericList n_a1kWH t_a1kWI e_a1kWJ) (GenericList n_a1kWH t_a1laN e_a1laO) (t_a1kWI e_a1kWJ) (t_a1laN e_a1laO)
+ Brick.Widgets.List: listElementsL :: forall n_a1l0R t_a1l0S e_a1l0T t_a1leX e_a1leY. Lens (GenericList n_a1l0R t_a1l0S e_a1l0T) (GenericList n_a1l0R t_a1leX e_a1leY) (t_a1l0S e_a1l0T) (t_a1leX e_a1leY)
- Brick.Widgets.List: listItemHeightL :: forall n_a1kWH t_a1kWI e_a1kWJ. Lens' (GenericList n_a1kWH t_a1kWI e_a1kWJ) Int
+ Brick.Widgets.List: listItemHeightL :: forall n_a1l0R t_a1l0S e_a1l0T. Lens' (GenericList n_a1l0R t_a1l0S e_a1l0T) Int
- Brick.Widgets.List: listNameL :: forall n_a1kWH t_a1kWI e_a1kWJ n_a1laP. Lens (GenericList n_a1kWH t_a1kWI e_a1kWJ) (GenericList n_a1laP t_a1kWI e_a1kWJ) n_a1kWH n_a1laP
+ Brick.Widgets.List: listNameL :: forall n_a1l0R t_a1l0S e_a1l0T n_a1leZ. Lens (GenericList n_a1l0R t_a1l0S e_a1l0T) (GenericList n_a1leZ t_a1l0S e_a1l0T) n_a1l0R n_a1leZ
- Brick.Widgets.List: listSelectedL :: forall n_a1kWH t_a1kWI e_a1kWJ. Lens' (GenericList n_a1kWH t_a1kWI e_a1kWJ) (Maybe Int)
+ Brick.Widgets.List: listSelectedL :: forall n_a1l0R t_a1l0S e_a1l0T. Lens' (GenericList n_a1l0R t_a1l0S e_a1l0T) (Maybe Int)

Files

CHANGELOG.md view
@@ -2,6 +2,18 @@ Brick changelog --------------- +0.72+----++Package changes:+ * Increased lower bound on `text-zipper` to `0.12`.++API changes:+ * `handleEditorEvent` now takes a `BrickEvent` rather than just a Vty+   `Event`.+ * Brick editors now handle mouse clicks to change their cursor+   positions.+ 0.71.1 ------ 
brick.cabal view
@@ -1,5 +1,5 @@ name:                brick-version:             0.71.1+version:             0.72 synopsis:            A declarative terminal user interface library description:   Write terminal user interfaces (TUIs) painlessly with 'brick'! You@@ -128,7 +128,7 @@                        contravariant,                        stm >= 2.4.3,                        text,-                       text-zipper >= 0.11,+                       text-zipper >= 0.12,                        template-haskell,                        deepseq >= 1.3 && < 1.5,                        unix,
programs/EditDemo.hs view
@@ -48,17 +48,17 @@             str "Press Tab to switch between editors, Esc to quit."  appEvent :: St -> T.BrickEvent Name e -> T.EventM Name (T.Next St)-appEvent st (T.VtyEvent ev) =-    case ev of-        V.EvKey V.KEsc [] -> M.halt st-        V.EvKey (V.KChar '\t') [] -> M.continue $ st & focusRing %~ F.focusNext-        V.EvKey V.KBackTab [] -> M.continue $ st & focusRing %~ F.focusPrev--        _ -> M.continue =<< case F.focusGetCurrent (st^.focusRing) of-               Just Edit1 -> T.handleEventLensed st edit1 E.handleEditorEvent ev-               Just Edit2 -> T.handleEventLensed st edit2 E.handleEditorEvent ev-               Nothing -> return st-appEvent st _ = M.continue st+appEvent st (T.VtyEvent (V.EvKey V.KEsc [])) =+    M.halt st+appEvent st (T.VtyEvent (V.EvKey (V.KChar '\t') [])) =+    M.continue $ st & focusRing %~ F.focusNext+appEvent st (T.VtyEvent (V.EvKey V.KBackTab [])) =+    M.continue $ st & focusRing %~ F.focusPrev+appEvent st ev =+    M.continue =<< case F.focusGetCurrent (st^.focusRing) of+      Just Edit1 -> T.handleEventLensed st edit1 E.handleEditorEvent ev+      Just Edit2 -> T.handleEventLensed st edit2 E.handleEditorEvent ev+      Nothing -> return st  initialState :: St initialState =
programs/MouseDemo.hs view
@@ -3,7 +3,7 @@ {-# LANGUAGE TemplateHaskell #-} module Main where -import Lens.Micro ((^.), (&), (.~), (%~))+import Lens.Micro ((^.), (&), (.~)) import Lens.Micro.TH (makeLenses) import Control.Monad (void) #if !(MIN_VERSION_base(4,11,0))@@ -20,8 +20,6 @@ import qualified Brick.Widgets.Center as C import qualified Brick.Widgets.Border as B import Brick.Widgets.Core-import Data.Text.Zipper (moveCursor)-import Data.Tuple (swap)  data Name = Info | Button1 | Button2 | Button3 | Prose | TextBox           deriving (Show, Ord, Eq)@@ -86,17 +84,17 @@                C.hCenter $ str msg  appEvent :: St -> T.BrickEvent Name e -> T.EventM Name (T.Next St)-appEvent st (T.MouseDown n _ _ loc) = do-    let T.Location pos = loc-    M.continue $ st & lastReportedClick .~ Just (n, loc)-                    & edit %~ E.applyEdit (if n == TextBox then moveCursor (swap pos) else id)+appEvent st ev@(T.MouseDown n _ _ loc) =+    M.continue =<< T.handleEventLensed (st & lastReportedClick .~ Just (n, loc))+                                       edit+                                       E.handleEditorEvent+                                       ev appEvent st (T.MouseUp {}) = M.continue $ st & lastReportedClick .~ Nothing appEvent st (T.VtyEvent (V.EvMouseUp {})) = M.continue $ st & lastReportedClick .~ Nothing appEvent st (T.VtyEvent (V.EvKey V.KUp [V.MCtrl])) = M.vScrollBy (M.viewportScroll Prose) (-1) >> M.continue st appEvent st (T.VtyEvent (V.EvKey V.KDown [V.MCtrl])) = M.vScrollBy (M.viewportScroll Prose) 1 >> M.continue st appEvent st (T.VtyEvent (V.EvKey V.KEsc [])) = M.halt st-appEvent st (T.VtyEvent ev) = M.continue =<< T.handleEventLensed st edit E.handleEditorEvent ev-appEvent st _ = M.continue st+appEvent st ev = M.continue =<< T.handleEventLensed st edit E.handleEditorEvent ev  aMap :: AttrMap aMap = attrMap V.defAttr
src/Brick/Forms.hs view
@@ -522,15 +522,13 @@                      then id                      else Z.moveCursor pos         initialText = ini $ initialState ^. stLens-        handleEvent (VtyEvent e) ed = handleEditorEvent e ed-        handleEvent _ ed = return ed      in FormFieldState { formFieldState = initVal                       , formFields = [ FormField n                                                  (val . getEditContents)                                                  True                                                  (\b e -> wrapEditor $ renderEditor renderText b e)-                                                 handleEvent+                                                 handleEditorEvent                                      ]                       , formFieldLens = stLens                       , formFieldUpdate = \newVal e ->
src/Brick/Widgets/Edit.hs view
@@ -53,6 +53,7 @@ import qualified Data.Text.Zipper as Z hiding ( textZipper ) import qualified Data.Text.Zipper.Generic as Z import qualified Data.Text.Zipper.Generic.Words as Z+import Data.Tuple (swap)  import Brick.Types import Brick.Widgets.Core@@ -114,48 +115,56 @@ instance DecodeUtf8 String where     decodeUtf8 bs = T.unpack <$> decodeUtf8 bs -handleEditorEvent :: (DecodeUtf8 t, Eq t, Z.GenericTextZipper t)-                  => Event -> Editor t n -> EventM n (Editor t n)-handleEditorEvent e ed =-        let f = case e of-                  EvPaste bs -> case decodeUtf8 bs of-                      Left _ -> id-                      Right t -> Z.insertMany t-                  EvKey (KChar 'a') [MCtrl] -> Z.gotoBOL-                  EvKey (KChar 'e') [MCtrl] -> Z.gotoEOL-                  EvKey (KChar 'd') [MCtrl] -> Z.deleteChar-                  EvKey (KChar 'd') [MMeta] -> Z.deleteWord-                  EvKey (KChar 'k') [MCtrl] -> Z.killToEOL-                  EvKey (KChar 'u') [MCtrl] -> Z.killToBOL-                  EvKey KEnter [] -> Z.breakLine-                  EvKey KDel [] -> Z.deleteChar-                  EvKey (KChar c) [] | c /= '\t' -> Z.insertChar c-                  EvKey KUp [] -> Z.moveUp-                  EvKey KDown [] -> Z.moveDown-                  EvKey KLeft [] -> Z.moveLeft-                  EvKey KRight [] -> Z.moveRight-                  EvKey (KChar 'b') [MCtrl] -> Z.moveLeft-                  EvKey (KChar 'f') [MCtrl] -> Z.moveRight-                  EvKey (KChar 'b') [MMeta] -> Z.moveWordLeft-                  EvKey (KChar 'f') [MMeta] -> Z.moveWordRight-                  EvKey KBS [] -> Z.deletePrevChar-                  EvKey (KChar 't') [MCtrl] -> Z.transposeChars-                  EvKey KHome [] -> Z.gotoBOL-                  EvKey KEnd [] -> Z.gotoEOL-                  EvKey (KChar '<') [MMeta] -> Z.gotoBOF-                  EvKey (KChar '>') [MMeta] -> Z.gotoEOF-                  _ -> id-        in return $ applyEdit f ed+handleEditorEvent :: (Eq n, DecodeUtf8 t, Eq t, Z.GenericTextZipper t)+                  => BrickEvent n e+                  -> Editor t n+                  -> EventM n (Editor t n)+handleEditorEvent e ed = return $ applyEdit f ed+    where+        f = case e of+              VtyEvent ev ->+                  handleVtyEvent ev+              MouseDown n _ _ (Location pos) | n == getName ed ->+                  Z.moveCursorClosest (swap pos)+              _ -> id+        handleVtyEvent ev = case ev of+            EvPaste bs -> case decodeUtf8 bs of+                Left _ -> id+                Right t -> Z.insertMany t+            EvKey (KChar 'a') [MCtrl] -> Z.gotoBOL+            EvKey (KChar 'e') [MCtrl] -> Z.gotoEOL+            EvKey (KChar 'd') [MCtrl] -> Z.deleteChar+            EvKey (KChar 'd') [MMeta] -> Z.deleteWord+            EvKey (KChar 'k') [MCtrl] -> Z.killToEOL+            EvKey (KChar 'u') [MCtrl] -> Z.killToBOL+            EvKey KEnter [] -> Z.breakLine+            EvKey KDel [] -> Z.deleteChar+            EvKey (KChar c) [] | c /= '\t' -> Z.insertChar c+            EvKey KUp [] -> Z.moveUp+            EvKey KDown [] -> Z.moveDown+            EvKey KLeft [] -> Z.moveLeft+            EvKey KRight [] -> Z.moveRight+            EvKey (KChar 'b') [MCtrl] -> Z.moveLeft+            EvKey (KChar 'f') [MCtrl] -> Z.moveRight+            EvKey (KChar 'b') [MMeta] -> Z.moveWordLeft+            EvKey (KChar 'f') [MMeta] -> Z.moveWordRight+            EvKey KBS [] -> Z.deletePrevChar+            EvKey (KChar 't') [MCtrl] -> Z.transposeChars+            EvKey KHome [] -> Z.gotoBOL+            EvKey KEnd [] -> Z.gotoEOL+            EvKey (KChar '<') [MMeta] -> Z.gotoBOF+            EvKey (KChar '>') [MMeta] -> Z.gotoEOF+            _ -> id  -- | Construct an editor over 'Text' values editorText :: n-       -- ^ The editor's name (must be unique)-       -> Maybe Int-       -- ^ The limit on the number of lines in the editor ('Nothing'-       -- means no limit)-       -> T.Text-       -- ^ The initial content-       -> Editor T.Text n+           -- ^ The editor's name (must be unique)+           -> Maybe Int+           -- ^ The limit on the number of lines in the editor ('Nothing'+           -- means no limit)+           -> T.Text+           -- ^ The initial content+           -> Editor T.Text n editorText = editor  -- | Construct an editor over 'String' values