on master help sign in
export "empty_image" from Graphics.Vty.Picture

Ignore-this: 75203e75c39528fd287dc8e49ee8a361 thanks allan.clark@gmail.com darcs-hash:20090906024209-f0a0d-df85e22d4bfc215993d148c02750e306ab986098.gz

commitf66f30b7cc4eb2dbd9372d0ef53ad97927a5b5d2 authorcoreyoconnor <coreyoconnor@gmail.com> dateSat 5 Sep 2009, 19:42 (17 years ago) parentdcc2951
3 files changed+13−1
src/Graphics/Vty/Image.hs+11−1 src/Graphics/Vty/Picture.hs+1 test/Makefile+1
src/Graphics/Vty/Image.hs+11−1
@@ -19,6 +19,7 @@ module Graphics.Vty.Image ( Image(..)
1919 , utf8_string
2020 , utf8_bytestring
2121 , char_fill
22+ , empty_image
2223 -- | The possible display attributes used in constructing an `Image`.
2324 , module Graphics.Vty.Attributes
2425 )
@@ -91,7 +92,11 @@ data Image =
9192 { output_width :: !Word -- >= 1
9293 , output_height :: !Word -- >= 1
9394 }
94− -- Any image of zero size equals the id image
95+ -- The combining operators identity constant.
96+ -- IdImage <|> a = a
97+ -- IdImage <-> a = a
98+ --
99+ -- Any image of zero size equals the identity image.
95100 | IdImage
96101 deriving Eq
97102
@@ -310,3 +315,8 @@ char_fill :: Enum d => Attr -> Char -> d -> d -> Image
310315char_fill !a !c w h =
311316 vert_cat $ replicate (fromEnum h) $ horiz_cat $ replicate (fromEnum w) $ char a c
312317
318+-- | The empty image. Useful for fold combinators. These occupy no space nor define any display
319+-- attributes.
320+empty_image :: Image
321+empty_image = IdImage
322+
src/Graphics/Vty/Picture.hs+1
@@ -16,6 +16,7 @@ module Graphics.Vty.Picture ( module Graphics.Vty.Picture
1616 , utf8_string
1717 , utf8_bytestring
1818 , char_fill
19+ , empty_image
1920 -- | The possible display attributes used in constructing an `Image`.
2021 , module Graphics.Vty.Attributes
2122 )
test/Makefile+1
@@ -4,6 +4,7 @@ verify_control_strings \
44verify_utf8_width \
55verify_image_ops \
66verify_image_trans \
7+verify_empty_image_props \
78verify_picture_ops \
89verify_span_ops \
910verify_debug_terminal