Created
May 24, 2017 08:41
-
-
Save kosmikus/b20423dd1d44826ebc173e558f49cc37 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type family SExprExt (ext :: k1) (f :: k2) = (r :: (* -> *)) | r -> ext where | |
SExprExt ('[] :: [* -> *]) f = Union (MapList ('[] :: [* -> *]) f) | |
SExprExt r f = Union (MapList r f) | |
class (Functor (SExprExt ext f), Foldable (SExprExt ext f), Traversable (SExprExt ext f)) => SimpleExprExtension ext f a where | |
functorWitness :: p ext f a -> Dict (Functor (SExprExt ext f)) | |
functorWitness _ = Dict | |
foldableWitness :: p ext f a -> Dict (Foldable (SExprExt ext f)) | |
foldableWitness _ = Dict | |
traversableWitness :: p ext f a -> Dict (Traversable (SExprExt ext f)) | |
traversableWitness _ = Dict | |
type family MapList (l :: [ * -> * ]) f = (r :: [* -> *] ) | r -> l where | |
MapList '[] f = '[] | |
MapList (ext ': rest) f = (SExprExt ext f) ': MapList rest f | |
type MapConstraint constr l f = ConstrainedMembers constr (MapList l f) | |
instance (Functor (SExprExt ext f), Foldable (SExprExt ext f), Traversable (SExprExt ext f)) => SimpleExprExtension ext f a |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment