Skip to content

Instantly share code, notes, and snippets.

@kosmikus
Created January 31, 2017 20:04
Show Gist options
  • Save kosmikus/5da7ee37a151a2c07c3275d05f4a98c5 to your computer and use it in GitHub Desktop.
Save kosmikus/5da7ee37a151a2c07c3275d05f4a98c5 to your computer and use it in GitHub Desktop.
{-# LANGUAGE RankNTypes, TypeFamilies, ConstraintKinds #-}
type family F x where
F () = Int
F x = Char
class Foo x where
foo :: x -> F x
f :: (c (), Foo b) => proxy c -> (forall a . c a => a -> b) -> F b
f _ g = foo (g ())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment