2 {-# OPTIONS_GHC -Wno-unused-top-binds #-}
4 module Logic.Theory.Semigroup (
7 type NonEmptyConcat (),
11 import Data.List.NonEmpty qualified as NonEmpty
12 import Data.Semigroup qualified as Semigroup
14 import Logic.Theory.Arithmetic
15 import Logic.Theory.List
16 import Logic.Theory.Ord
18 data (<>) aN bN = AppendAxiom
19 type role (<>) nominal nominal
21 data NonEmptyConcat aN = NonEmptyConcatAxiom
22 type role NonEmptyConcat nominal
24 (<>) :: Semigroup.Semigroup a => aN ::: a -> bN ::: a -> (<>) aN bN ::: a
25 (<>) (Named x) (Named y) = AppendAxiom ... (x Semigroup.<> y)
27 sconcat :: Semigroup.Semigroup a => aN ::: [a] / Zero < ListLength aN -> NonEmptyConcat aN ::: a
28 sconcat (Named xs) = NonEmptyConcatAxiom ... Semigroup.sconcat (NonEmpty.fromList xs)