1 -----------------------------------------------------------------------------
4 -- Module : Distribution.Compat.SnocList
7 -- Maintainer : cabal-dev@haskell.org
8 -- Stability : experimental
9 -- Portability : portable
11 -- A very reversed list. Has efficient `snoc`
12 module Distribution
.Compat
.SnocList
18 import Distribution
.Compat
.Prelude
21 newtype SnocList a
= SnocList
[a
]
23 snoc
:: SnocList a
-> a
-> SnocList a
24 snoc
(SnocList xs
) x
= SnocList
(x
: xs
)
26 runSnocList
:: SnocList a
-> [a
]
27 runSnocList
(SnocList xs
) = reverse xs
29 instance Semigroup
(SnocList a
) where
30 SnocList xs
<> SnocList ys
= SnocList
(ys
<> xs
)
32 instance Monoid
(SnocList a
) where