diff --git a/aspecs/lib/Asterix/Specs/Types.hs b/aspecs/lib/Asterix/Specs/Types.hs index 4a529db..b4fee38 100644 --- a/aspecs/lib/Asterix/Specs/Types.hs +++ b/aspecs/lib/Asterix/Specs/Types.hs @@ -11,9 +11,15 @@ newtype CatNum = CatNum Int newtype BitSize = BitSize Int deriving (Generic, Eq, Ord, Show, Read) +instance Semigroup BitSize where BitSize a <> BitSize b = BitSize (a+b) +instance Monoid BitSize where mempty = BitSize 0 + newtype ByteSize = ByteSize Int deriving (Generic, Eq, Ord, Show, Read) +instance Semigroup ByteSize where ByteSize a <> ByteSize b = ByteSize (a+b) +instance Monoid ByteSize where mempty = ByteSize 0 + newtype ItemName = ItemName Text deriving (Generic, Eq, Ord, Show, Read) diff --git a/aspecs/lib/Asterix/Specs/Validation.hs b/aspecs/lib/Asterix/Specs/Validation.hs index 33f352a..f5a021c 100644 --- a/aspecs/lib/Asterix/Specs/Validation.hs +++ b/aspecs/lib/Asterix/Specs/Validation.hs @@ -204,7 +204,7 @@ catUapItems = mapMaybe f where UapItem name -> Just name _ -> Nothing -instance Validate ([Item ()], (Uap [UapItem ItemName])) where +instance Validate ([Item ()], Uap [UapItem ItemName]) where validate (catalogue, uap) = case uap of Uap lst -> validateList lst Uaps lst1 msel -> do