1
1
mirror of https://github.com/github/semantic.git synced 2024-11-25 02:58:36 +03:00

📝 prj.

This commit is contained in:
Rob Rix 2019-10-08 15:08:37 -04:00
parent ad1de17e64
commit 4e194a5943
No known key found for this signature in database
GPG Key ID: F188A01508EA1CF7

View File

@ -8,6 +8,7 @@ import GHC.TypeLits (ErrorMessage(..), TypeError)
-- | Projection of an element out of a tree of sums, particularly suitable for use with highly branching (e.g. balanced) trees. -- | Projection of an element out of a tree of sums, particularly suitable for use with highly branching (e.g. balanced) trees.
class Element sub sup where class Element sub sup where
-- | Project one element out of a sum type.
prj :: sup a -> Maybe (sub a) prj :: sup a -> Maybe (sub a)
instance (Element' elem sub sup, elem ~ Elem sub sup) => Element sub sup where instance (Element' elem sub sup, elem ~ Elem sub sup) => Element sub sup where