Created
March 13, 2020 20:50
-
-
Save Pitometsu/cfbc511ad877e5d1ddf36b5ae6b7ea2f to your computer and use it in GitHub Desktop.
constraints family
This file contains 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
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE TypeOperators #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE ConstraintKinds #-} | |
{-# LANGUAGE PolyKinds #-} | |
import Data.Kind (Constraint) | |
type family All (c :: k -> Constraint) ts :: Constraint where All c '[] = (); All c (t:ts) = (c t, All c ts) | |
m :: (All Applicative '[a, b], All Traversable '[a, b]) => a x -> b x | |
m = undefined |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment