[Haskell-cafe] Void vs ()

Bardur Arantsson spam at scientician.net
Fri Mar 24 22:11:27 UTC 2017


On 2017-03-24 22:50, MarLinn wrote:
> 
>> My question is then: What's the best thing to use for "x", Void or ()?
>> […]
>> An alernative I've been considering is actually to create a Foo' type
>> which actually does eliminate the i parameter 
> 
> This is only a partial answer, but why not role your own i? And why not
> define Foo' in terms of Foo and whatever you end up using?
> 

Not sure what you mean by "role your own i"

... but Foo' as a newtype of Foo might actually make a lot of sense. I
think I'm *mostly* using type-class methods on the Foo, so I can just
"propagate" those trivially. I hadn't considered that idea, thanks!

(I'm sure it'll work out, but I'll at least try it to see how it works
with the rest of the code.)

> data ThereIsNoIOnlyZuul    -- intentionally left blank
> 
> type Foo' e n = Foo ThereIsNoIOnlyZuul e n    -- extra types included
> for clarity
> 

Well, Void *is* ThereIsNoIOnlyZuul, at least AFAICT? :)

Regards,



More information about the Haskell-Cafe mailing list