[Haskell-cafe] Announcing OneTuple-0.1.0
Luke Palmer
lrpalmer at gmail.com
Thu Oct 2 03:49:51 EDT 2008
On Thu, Oct 2, 2008 at 1:17 AM, Simon Brenner <olsner at gmail.com> wrote:
> On 10/2/08, ajb at spamcop.net <ajb at spamcop.net> wrote:
>> G'day all.
>>
>> Quoting John Dorsey <haskell at colquitt.org>:
>>
>>
>> > Contributions are welcome. The project could use a tutorial, and a
>> > decent test suite. Strict singleton tuples are planned for the next
>> > version.
>> >
>>
>> I hope it has a Monad instance.
>
> You could always use this one-tuple instead and get Functor, Monad and
> MonadFix for free:
> http://hackage.haskell.org/packages/archive/mtl/1.1.0.1/doc/html/Control-Monad-Identity.html
But that one is different:
newtype Identity a = Identity { runIdentity :: a }
data OneTuple a = OneTuple { only :: a }
So OneTuple has one more value than Identity (Identity Int has
Identity _|_ and Identity n for each n, whereas OneTuple Int has _|_,
OneTuple _|_, and OneTuple n for each n)
Luke
More information about the Haskell-Cafe
mailing list