on master help sign in
Merge pull request #78 from jtdaugherty/master

Various minor changes

commit8c09af03f51adfc255b0ef95cc07311f40821ce6 authorCorey O'Connor <coreyoconnor@gmail.com> dateMon 27 Jul 2015, 12:26 (11 years ago) parent149ef899cfcb22
3 files changed+6−4
src/Graphics/Vty/Attributes.hs+3−2 src/Graphics/Vty/Attributes/Color.hs+1−1 src/Graphics/Vty/Image.hs+2−1
src/Graphics/Vty/Attributes.hs+3−2
@@ -49,7 +49,7 @@ data Attr = Attr
4949 { attrStyle :: !(MaybeDefault Style)
5050 , attrForeColor :: !(MaybeDefault Color)
5151 , attrBackColor :: !(MaybeDefault Color)
52− } deriving ( Eq, Show )
52+ } deriving ( Eq, Show, Read )
5353
5454-- This could be encoded into a single 32 bit word. The 32 bit word is first divided
5555-- into 4 groups of 8 bits where: The first group codes what action should be taken with regards to
@@ -103,10 +103,11 @@ data FixedAttr = FixedAttr
103103data MaybeDefault v where
104104 Default :: MaybeDefault v
105105 KeepCurrent :: MaybeDefault v
106− SetTo :: forall v . ( Eq v, Show v ) => !v -> MaybeDefault v
106+ SetTo :: forall v . ( Eq v, Show v, Read v ) => !v -> MaybeDefault v
107107
108108deriving instance Eq v => Eq (MaybeDefault v)
109109deriving instance Eq v => Show (MaybeDefault v)
110+deriving instance (Eq v, Show v, Read v) => Read (MaybeDefault v)
110111
111112instance Eq v => Monoid ( MaybeDefault v ) where
112113 mempty = KeepCurrent
src/Graphics/Vty/Attributes/Color.hs+1−1
@@ -47,5 +47,5 @@ import Data.Word
4747--
4848-- Seriously, terminal color support is INSANE.
4949data Color = ISOColor !Word8 | Color240 !Word8
50− deriving ( Eq, Show )
50+ deriving ( Eq, Show, Read )
5151
src/Graphics/Vty/Image.hs+2−1
@@ -117,7 +117,8 @@ char a c =
117117-- directly to iso10646String or string.
118118--
119119iso10646String :: Attr -> String -> Image
120−iso10646String a str =
120+iso10646String _ [] = EmptyImage
121+iso10646String a str =
121122 let displayWidth = safeWcswidth str
122123 in HorizText a (TL.pack str) displayWidth (length str)
123124