Skip to content

Instantly share code, notes, and snippets.

@Pitometsu
Created March 13, 2020 20:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Pitometsu/cfbc511ad877e5d1ddf36b5ae6b7ea2f to your computer and use it in GitHub Desktop.
Save Pitometsu/cfbc511ad877e5d1ddf36b5ae6b7ea2f to your computer and use it in GitHub Desktop.
constraints family
{-# 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