Skip to content

Commit

Permalink
minor types update
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoran Bošnjak committed Mar 6, 2024
1 parent 7980de8 commit a582422
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions aspecs/lib/Asterix/Specs/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion aspecs/lib/Asterix/Specs/Validation.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a582422

Please sign in to comment.