on master help sign in
Adding Monoid instance for Image. Incorrect, but sufficient for now

Ignore-this: 752b45d1484f0fd5916479ef2b79f1dd darcs-hash:20091007040051-f0a0d-228c96088712a0dc3f2bc25bf64d39495db47298.gz

commit7414e119d625ee322e5749e89fd43ada723c1a2c authorcoreyoconnor <coreyoconnor@gmail.com> dateTue 6 Oct 2009, 21:00 (17 years ago) parentfe55cd4
2 files changed+44−5
src/Graphics/Vty/Image.hs+7 vty.cabal+37−5
src/Graphics/Vty/Image.hs+7
@@ -32,6 +32,7 @@ import Codec.Binary.UTF8.Width
3232import Codec.Binary.UTF8.String ( decode )
3333
3434import qualified Data.ByteString as BS
35+import Data.Monoid
3536import qualified Data.Sequence as Seq
3637import qualified Data.String.UTF8 as UTF8
3738import Data.Word
@@ -111,6 +112,12 @@ instance Show Image where
111112 = "VertJoin (" ++ show c ++ ", " ++ show r ++ ") ( " ++ show t ++ " ) <-> ( " ++ show b ++ " )"
112113 show ( IdImage ) = "IdImage"
113114
115+-- | Currently append in the Monoid instance is equivalent to <->. Future versions will just stack
116+-- the images.
117+instance Monoid Image where
118+ mempty = empty_image
119+ mappend = (<->)
120+
114121-- A horizontal text image of 0 characters in width simplifies to the IdImage
115122horiz_text :: Attr -> StringSeq -> Word -> Image
116123horiz_text a txt ow
vty.cabal+37−5
@@ -32,8 +32,6 @@ Build-Depends: array
3232Build-Depends: parsec >= 3 && < 4
3333Build-Type: Simple
3434Data-Files: README, TODO
35−Extra-Source-Files: test/Test.hs, cbits/gwinsz.h, test/Bench.hs
36−
3735Exposed-Modules: Graphics.Vty
3836 Graphics.Vty.Terminal
3937 Graphics.Vty.LLInput
@@ -56,8 +54,42 @@ C-Sources: cbits/gwinsz.c
5654 cbits/mk_wcwidth.c
5755Include-Dirs: cbits
5856hs-source-dirs: src
59−Install-Includes: gwinsz.h
57+Extra-Source-Files: test/Makefile
58+ test/Bench2.hs
59+ test/Bench.hs
60+ test/BenchRenderChar.hs
61+ test/ControlTable.hs
62+ test/HereDoc.hs
63+ test/interactive_terminal_test.hs
64+ test/Test2.hs
65+ test/Test.hs
66+ test/verify_attribute_ops.hs
67+ test/verify_debug_terminal.hs
68+ test/verify_eval_terminfo_caps.hs
69+ test/Verify.hs
70+ test/verify_image_ops.hs
71+ test/verify_image_trans.hs
72+ test/verify_parse_terminfo_caps.hs
73+ test/verify_picture_ops.hs
74+ test/verify_picture_to_span.hs
75+ test/verify_span_ops.hs
76+ test/verify_utf8_width.hs
77+ test/vty_issue_18.hs
78+ test/yi_issue_264.hs
79+ test/Verify/Graphics/Vty/Attributes.hs
80+ test/Verify/Graphics/Vty/Picture.hs
81+ test/Verify/Graphics/Vty/Span.hs
82+ test/Verify/Graphics/Vty/DisplayRegion.hs
83+ test/Verify/Graphics/Vty/Image.hs
84+ test/Verify/Data/Terminfo/Parse.hs
85+ src/Codec/Binary/UTF8/Debug.hs
86+ src/Graphics/Vty/Terminal/Debug.hs
87+ src/Graphics/Vty/Debug.hs
88+ cbits/gwinsz.c
89+ cbits/mk_wcwidth.c
90+ cbits/set_term_timing.c
91+ cbits/gwinsz.h
6092
61−ghc-options: -funbox-strict-fields -Wall -threaded
62−ghc-prof-options: -funbox-strict-fields -auto-all -Wall -threaded
93+ghc-options: -funbox-strict-fields -Wall -fno-full-laziness -fspec-constr
94+ghc-prof-options: -funbox-strict-fields -caf-all -Wall -fno-full-laziness -fspec-constr
6395