Created
March 7, 2019 14:47
-
-
Save dmwit/4cceddecaf139b1428c0199378f044b3 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
{-# LANGUAGE TypeFamilies #-} | |
class Foo a where | |
type I a t | |
foo :: I a t -> t -> a | |
instance Foo () where | |
type I () t = () | |
foo _ _ = () | |
instance Foo b => Foo (a, b) where | |
type I (a, b) t = (t -> a, I b t) | |
foo (f, gs) t = (f t, foo gs t) | |
-- > foo ((+1), ((+2), ((+3), ()))) 0 :: (Int, (Int, (Int, ()))) | |
-- (1,(2,(3,()))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment