[commit: haddock] master: Add scoped type variables test for polymorphism test case. (2b748bb)
git at git.haskell.org
git at git.haskell.org
Wed Jul 8 08:42:16 UTC 2015
Repository : ssh://git@git.haskell.org/haddock
On branch : master
Link : http://git.haskell.org/haddock.git/commitdiff/2b748bb10a40d3787bea35fc24564edac64b11c9
>---------------------------------------------------------------
commit 2b748bb10a40d3787bea35fc24564edac64b11c9
Author: Łukasz Hanuszczak <lukasz.hanuszczak at gmail.com>
Date: Wed Jul 1 19:34:22 2015 +0200
Add scoped type variables test for polymorphism test case.
>---------------------------------------------------------------
2b748bb10a40d3787bea35fc24564edac64b11c9
hypsrc-test/src/Polymorphism.hs | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/hypsrc-test/src/Polymorphism.hs b/hypsrc-test/src/Polymorphism.hs
index 2e1a93b..a74ac49 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
More information about the ghc-commits
mailing list