From 2b748bb10a40d3787bea35fc24564edac64b11c9 Mon Sep 17 00:00:00 2001 From: Ɓukasz Hanuszczak Date: Wed, 1 Jul 2015 19:34:22 +0200 Subject: Add scoped type variables test for polymorphism test case. --- hypsrc-test/src/Polymorphism.hs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'hypsrc-test') diff --git a/hypsrc-test/src/Polymorphism.hs b/hypsrc-test/src/Polymorphism.hs index 2e1a93bd..a74ac492 100644 --- a/hypsrc-test/src/Polymorphism.hs +++ b/hypsrc-test/src/Polymorphism.hs @@ -1,4 +1,5 @@ {-# LANGUAGE RankNTypes #-} +{-# LANGUAGE ScopedTypeVariables #-} module Polymorphism where @@ -53,3 +54,13 @@ norf = undefined norf' :: forall a. a -> (forall a. Ord a => a -> a) -> a norf' = undefined + + +plugh :: forall a. a -> a +plugh x = x :: a + +thud :: forall a b. (a -> b) -> a -> (a, b) +thud f x = + (x :: a, y) :: (a, b) + where + y = (f :: a -> b) x :: b -- cgit v1.2.3