Skip to content

Allow oneShot to work with unboxed types

Currently oneShot requires that both the argument type and the return type of the given function have the kind *. It would be nice if I could use unlifted types there.

The following program demonstrates this:

{-# LANGUAGE MagicHash #-}
module Foo where

import GHC.Exts
import GHC.Magic

f0 :: Int -> Int
f0 = oneShot $ \n -> n -- OK

f1 :: Int# -> Int
f1 = oneShot $ \n# -> I# n# -- Error, the argument type is unlifted

f2 :: Int -> Int#
f2 = oneShot $ \(I# n#) -> n# -- Error, the result type is unlifted
Trac metadata
Trac field Value
Version 7.10.2
Type FeatureRequest
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information