Skip to content

Commit 4710c3f

Browse files
committed
Update to lts-12.16
1 parent 9eb595b commit 4710c3f

File tree

5 files changed

+19
-9
lines changed

5 files changed

+19
-9
lines changed

rasa-ext-slate/src/Rasa/Ext/Slate/Internal/Attributes.hs

+4-1
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,13 @@ newtype AttrMonoid = AttrMonoid {
4444
getAttr :: V.Attr
4545
}
4646

47+
instance Semigroup AttrMonoid where
48+
AttrMonoid v <> AttrMonoid v' = AttrMonoid $ v <> v'
49+
50+
4751
-- | We want 'mempty' to be 'V.defAttr' instead of 'V.currentAttr' for use in 'combineSpans'.
4852
instance Monoid AttrMonoid where
4953
mempty = AttrMonoid V.defAttr
50-
AttrMonoid v `mappend` AttrMonoid v' = AttrMonoid $ v `mappend` v'
5154

5255
-- | Apply a list of styles to the given text, resulting in a 'V.Image'.
5356
applyAttrs :: RenderInfo -> V.Image

rasa-ext-views/src/Rasa/Ext/Views/Internal/Widgets.hs

+4-2
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,12 @@ data Widgets = Widgets
3838

3939
makeLenses ''Widgets
4040

41+
instance Semigroup Widgets where
42+
(Widgets a b c d) <> (Widgets a' b' c' d') =
43+
Widgets (a<>a') (b<>b') (c<>c') (d<>d')
44+
4145
instance Monoid Widgets where
4246
mempty = Widgets mempty mempty mempty mempty
43-
(Widgets a b c d) `mappend` (Widgets a' b' c' d') =
44-
Widgets (a<>a') (b<>b') (c<>c') (d<>d')
4547

4648
class HasWidgets r where
4749
computeWidgets :: r -> App Widgets

rasa/src/Rasa/Internal/Styles.hs

+4-1
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,20 @@ newtype Style = Style (Maybe Color, Maybe Color, Maybe Flair)
5555
instance Default Style where
5656
def = Style (Just DefColor, Just DefColor, Just DefFlair)
5757

58+
instance Semigroup Style where
59+
Style (a, b, c) <> Style (a', b', c') = Style (a' <|> a, b' <|> b, c' <|> c)
60+
5861
-- | The monoid instance replaces any attributes which have a 'Just' in the new 'Style'
5962
-- and persists any that are 'Nothing' in the new style (using 'Data.Alternative' for 'Data.Maybe')
6063
instance Monoid Style where
61-
Style (a, b, c) `mappend` Style (a', b', c') = Style (a' <|> a, b' <|> b, c' <|> c)
6264

6365
mempty = Style (Nothing, Nothing, Nothing)
6466

6567
type Styles = [Span CrdRange Style]
6668
newtype StyleMap =
6769
StyleMap Styles
6870
deriving (Show, Eq, Monoid)
71+
deriving (Show, Eq, Semigroup, Monoid)
6972

7073
instance Default StyleMap where
7174
def = StyleMap []

rasa/src/Rasa/Internal/Utility.hs

+6-4
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,16 @@ type Height = Int
3030
data RenderInfo =
3131
RenderInfo Y.YiString Styles
3232

33+
instance Semigroup RenderInfo where
34+
RenderInfo txtA stylesA <> RenderInfo txtB stylesB =
35+
RenderInfo
36+
(txtA <> txtB)
37+
(mappend stylesA $ first (moveRange (sizeOf txtA)) <$> stylesB)
38+
3339
-- | Appends to RenderInfo by appending the text and styles while preserving
3440
-- proper text/style alignment
3541
instance Monoid RenderInfo where
3642
mempty = RenderInfo mempty mempty
37-
RenderInfo txtA stylesA `mappend` RenderInfo txtB stylesB =
38-
RenderInfo
39-
(txtA `mappend` txtB)
40-
(mappend stylesA $ first (moveRange (sizeOf txtA)) <$> stylesB)
4143

4244
-- | Represents how to render an entity
4345
class Renderable r where

stack.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
flags: {}
2+
resolver: lts-12.16
23
extra-package-dbs: []
34

45
nix:
@@ -33,5 +34,4 @@ extra-deps:
3334
# extra-include-dirs:
3435
# - /usr/local/opt/icu4c/include
3536

36-
resolver: lts-10.7
3737
pvp-bounds: both

0 commit comments

Comments
 (0)