How to box/unbox values?

Julian Seward (Intl Vendor) v-julsew@microsoft.com
Tue, 10 Apr 2001 02:52:01 -0700


| -----Original Message-----
| From: Thomas Pasch [mailto:pasch@netzGeneration.com]
| Sent: Tuesday, April 10, 2001 12:55 AM
| To: glasgow-haskell-users@haskell.org
| Subject: How to box/unbox values?
|=20
|=20
| Hello,
|=20
| is there an easy way to box/unbox Types.
| I need this for Int's, so is there=20
| a function that does:
|=20
| Int# -> Int
| Int -> Int#

import GlaExts ( Int(..) )
iBox x =3D I# x
iUnbox (I# x) =3D x