[Haskell-cafe] Re: Polyvariadic functions operating with a monoid
kevinjardine at gmail.com
Sat Oct 9 08:28:25 EDT 2010
Yes, it compiles, but when I try to use polyToMonoid', it turns out
that this function is no longer polyvariadic, unlike the original
This may be what Luke meant when he wrote "you lose composability".
Even with the extra unwrap function I think that this is pretty cool,
but I would ideally like to hide the unwrap.
On Oct 9, 1:50 pm, Bartek Ćwikłowski <paczesi... at gmail.com> wrote:
> Hello Kevin,
> 2010/10/9 Kevin Jardine <kevinjard... at gmail.com>:
> > I was attempting to turn this into a small library and wanted to avoid
> > exporting unwrap.
> > I defined:
> > polyToMonoid' = unwrap . polyToMonoid
> If you disable MonomorphismRestriction this definition typechecks just
> fine. Alternatively, you can ask ghci about the type of "unwrap .
> polyToMonoid" and paste that into the type sig.
> Bartek Ćwikłowski
> Haskell-Cafe mailing list
> Haskell-C... at haskell.orghttp://www.haskell.org/mailman/listinfo/haskell-cafe
More information about the Haskell-Cafe