RE: [Haskell-cafe] Newbie question (again!) about phantom types

2007-08-08 Thread peterv
: [Haskell-cafe] Newbie question (again!) about phantom types > I'm having difficulty to understand what phantom types are good for. Is > this just for improving runtime performance? No. As the wiki says, you can use them to add static guarantees. > I read the wiki, and it says "th

Re: [Haskell-cafe] Newbie question (again!) about phantom types

2007-08-08 Thread David F. Place
On Aug 8, 2007, at 11:16 AM, peterv wrote: I’m having difficulty to understand what phantom types are good for. Is this just for improving runtime performance? I found phantom types to be useful in the implementation of bit-wise set operations. You can find the code Edison: http://ha

Re: [Haskell-cafe] Newbie question (again!) about phantom types

2007-08-08 Thread Arie Peterson
> I’m having difficulty to understand what phantom types are good for. Is > this just for improving runtime performance? No. As the wiki says, you can use them to add static guarantees. > I read the wiki, and it says "this is useful if you want to increase the > type-safety of your code", but th

Re: [Haskell-cafe] Newbie question (again!) about phantom types

2007-08-08 Thread Tillmann Rendel
peterv wrote: I’m having difficulty to understand what phantom types are good for. I read the wiki, and it says "this is useful if you want to increase the type-safety of your code", but the code below does not give a compiler error for the function test1, I get a runtime error, just like test2

[Haskell-cafe] Newbie question (again!) about phantom types

2007-08-08 Thread peterv
I’m having difficulty to understand what phantom types are good for. Is this just for improving runtime performance? I read the wiki, and it says "this is useful if you want to increase the type-safety of your code", but the code below does not give a compiler error for the function test1, I get