From 25ea9a3a8fab29490d0957f3b4e55e03458183d2 Mon Sep 17 00:00:00 2001 From: Ɓukasz Hanuszczak Date: Wed, 5 Aug 2015 21:08:42 +0200 Subject: Add examples with type operators to the instances test case. --- html-test/src/Instances.hs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'html-test') diff --git a/html-test/src/Instances.hs b/html-test/src/Instances.hs index b7bc8921..545c8534 100644 --- a/html-test/src/Instances.hs +++ b/html-test/src/Instances.hs @@ -3,11 +3,15 @@ {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE ImpredicativeTypes #-} {-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeOperators #-} module Instances where +newtype (<~~) a b = Xyzzy (b -> (a, a)) + + class Foo f where foo :: f Int -> a -> f a @@ -21,6 +25,8 @@ instance Foo [] instance (Eq a, Foo f) => Foo ((,) (f a)) instance Foo (Either a) instance Foo ((,,) a a) +instance Foo ((->) a) +instance Foo ((<~~) a) class Foo f => Bar f a where -- cgit v1.2.3