Skip to content

Commit

Permalink
somef: added type-aliases for existential containers
Browse files Browse the repository at this point in the history
  • Loading branch information
bruderj15 committed Nov 29, 2024
1 parent d6a9afd commit 53a8504
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Data/Some/Constraint.hs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ data Somes1 csf csa where
-- | Alias for 'Somes1' with just one 'Constraint'.
type Some1 cf ca = Somes1 '[cf] '[ca]

-- | Alias for 'Somes1' with a container @f@ and multple 'Constraint's @csa@ for its elements.
type SomesF f csa = Somes1 '[(~) f] csa

-- | Alias for 'SomeF' with just one 'Constraint' for its elements.
type SomeF f c = SomesF f '[c]

instance {-# OVERLAPPING #-} Show (Somes (Show ': cs)) where
showsPrec d (Some x) = showParen (d > 10) $ showString "Some " . showsPrec 11 x

Expand Down

0 comments on commit 53a8504

Please sign in to comment.