The use case I'm interested in is for exploratory programming, I define a type-driven compositional data-flow, and use void types until I'm ready to start filling in the gaps. Some data-dependencies may require class instances, and for this I currently use a stand-alone instance with undefined definitions.

Maybe there's a better way to go about this though? 


On Tue, Oct 29, 2013 at 3:31 PM, AntC <anthony_clayden@clear.net.nz> wrote:
> Lyndon Maydwell <maydwell <at> gmail.com> writes:
>
> I was wondering if it's possible to have automatic deriving
> for some classes for the Void type. ...
>

Hi Lyndon, I'm struggling to see any use case for that.

You'd 'achieve' `show (undefined :: Nada)` crashing your program at run-
time; rather than failing to compile (if you didn't have the instance).

Just bite the bullet and give your Void type a constructor.

AntC

>
> I guess the obvious one would be Show.
>
> data Nada deriving Show
>
> {*
> instance Show Nada where
>   show _ = undefined
> *}
>

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe