diff options
author | Łukasz Hanuszczak <lukasz.hanuszczak@gmail.com> | 2015-07-01 19:34:22 +0200 |
---|---|---|
committer | Łukasz Hanuszczak <lukasz.hanuszczak@gmail.com> | 2015-07-01 19:34:22 +0200 |
commit | 2b748bb10a40d3787bea35fc24564edac64b11c9 (patch) | |
tree | d5f9d261d3e1666ef9a6704c7ea4a1becf9b816d /hypsrc-test/src | |
parent | 571944f4a81feae7e04b05d1549a19e0b677f4eb (diff) |
Add scoped type variables test for polymorphism test case.
Diffstat (limited to 'hypsrc-test/src')
-rw-r--r-- | hypsrc-test/src/Polymorphism.hs | 11 |
1 files changed, 11 insertions, 0 deletions
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 |