[Haskell-cafe] [ANN] anonymous-sums

Roman Cheplyaka roma at ro-che.info
Sat Feb 15 14:08:01 UTC 2014


* Omari Norman <omari at smileystation.com> [2014-02-15 08:46:06-0500]
> On Fri, Feb 14, 2014 at 11:02 PM, Tikhon Jelvis <tikhon at jelv.is> wrote:
> > Yeah, S0 and S1 are probably worth including for the sake of completion. We
> > don't have a 1-tuple, and I believe that's caused a bit of trouble for
> > people writing generic libraries. Enough trouble so that somebody wrote a
> > OneTuple package[1] anyhow.
> 
> S1 is easy enough; I added that in.
> 
> http://hackage.haskell.org/package/anonymous-sums-0.2.2.0
> 
> S0 takes some more thought as there's more than one way to do that. I
> could use EmptyDataDecls or do it more like ekmett's Data.Void.  Then
> what do you get for, e.g., partitionS0?
> 
> partitionS0 :: [S0] -> ()
> 
> I suppose that makes sense if you look at partition as returning the
> same number of lists as there are type variables.  No type variables,
> no lists.  Or should it be
> 
> partitionS0 :: [S0] -> Void
> 
> which also makes me wonder if this is a special case better left to Data.Void.

The result should be a 0-tuple, i.e. (), of course. 

Otherwise, what would paritionS0 [] return?

Roman
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20140215/dc71ac08/attachment.sig>


More information about the Haskell-Cafe mailing list