[Haskell-cafe] Just for a laugh...
Andrew Coppin
andrewcoppin at btinternet.com
Fri Jun 1 14:39:32 EDT 2007
David Roundy wrote:
> On Fri, Jun 01, 2007 at 07:28:07PM +0100, Andrew Coppin wrote:
>
>> David Roundy wrote:
>>
>>> Note also that you can use unsafePerformIO to safely get pure functions
>>> doing both these operations.
>>>
>>>
>> I've always been puzzled by this one... how does unsafePerformIO
>> circumvent the type system? I don't understand.
>>
>
> It's a primitive. You couldn't implement it unless you're the
> compiler-writer. But it's a necesary primitive, if you wish to build
> efficient data types. You just need to carefully audit everywhere that
> unsafePerformIO is used.
>
No, I mean... how could you use unsafePerformIO to perform a typecast? I
don't see a way to do that.
More information about the Haskell-Cafe
mailing list