MarkupDemo: use explicit imports

This commit is contained in:
Jonathan Daugherty 2015-07-10 13:28:23 -07:00
parent ad9cffc2b7
commit 9fce0120b0

View File

@ -2,10 +2,13 @@
module Main where
import Data.Monoid ((<>))
import Graphics.Vty
import qualified Graphics.Vty as V
import Brick.Main
import Brick.Main (App(..), defaultMain, resizeOrQuit, neverShowCursor)
import Brick.Widgets.Core
( Widget
, (<=>)
)
import Brick.Util (on, fg)
import Brick.Markup (markup, (@?))
import Brick.AttrMap (attrMap, AttrMap)
@ -14,16 +17,16 @@ import Data.Text.Markup ((@@))
ui :: Widget
ui = m1 <=> m2
where
m1 = markup $ ("Hello" @@ fg blue) <> ", " <> ("world!" @@ fg red)
m1 = markup $ ("Hello" @@ fg V.blue) <> ", " <> ("world!" @@ fg V.red)
m2 = markup $ ("Hello" @? "keyword1") <> ", " <> ("world!" @? "keyword2")
theMap :: AttrMap
theMap = attrMap defAttr
[ ("keyword1", fg magenta)
, ("keyword2", white `on` blue)
theMap = attrMap V.defAttr
[ ("keyword1", fg V.magenta)
, ("keyword2", V.white `on` V.blue)
]
app :: App () Event
app :: App () V.Event
app =
App { appDraw = const [ui]
, appHandleEvent = resizeOrQuit