diff options
author | Joachim Breitner <mail@joachim-breitner.de> | 2015-08-07 10:36:32 +0200 |
---|---|---|
committer | Joachim Breitner <mail@joachim-breitner.de> | 2015-08-08 09:30:49 +0200 |
commit | 590aa0f03dda8bb71c7b6910e64aa6e7f951fbbf (patch) | |
tree | 2d79d9b29402d5bd1107948a625325b487be0ea2 /testsuite/tests/typecheck/should_compile/T10744.hs | |
parent | f1b4864d06c080b4b1234f2a5f16a6def25cd615 (diff) | |
download | haskell-590aa0f03dda8bb71c7b6910e64aa6e7f951fbbf.tar.gz |
Make oneShot open-kinded
akio wants to use oneShot with unlifted types as well, and there is no
good reason not to let him. This changes the type of the built-in
oneShot definition to open kinds, and also expand the documentation a
little bit.
Differential Revision: https://phabricator.haskell.org/D1136
Diffstat (limited to 'testsuite/tests/typecheck/should_compile/T10744.hs')
-rw-r--r-- | testsuite/tests/typecheck/should_compile/T10744.hs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_compile/T10744.hs b/testsuite/tests/typecheck/should_compile/T10744.hs new file mode 100644 index 0000000000..64219ad696 --- /dev/null +++ b/testsuite/tests/typecheck/should_compile/T10744.hs @@ -0,0 +1,17 @@ +{-# LANGUAGE MagicHash #-} +module T10744 where + +import GHC.Exts +import GHC.Magic + +-- Checks if oneShot is open-kinded + +f0 :: Int -> Int +f0 = oneShot $ \n -> n + +f1 :: Int# -> Int +f1 = oneShot $ \n# -> I# n# + +f2 :: Int -> Int# +f2 = oneShot $ \(I# n#) -> n# + |