[Haskell-cafe] [Alternative] change some/many semantics
Antoine Latter
aslatter at gmail.com
Thu Dec 15 06:36:53 CET 2011
On Wed, Dec 14, 2011 at 10:57 PM, Brandon Allbery <allbery.b at gmail.com> wrote:
> On Wed, Dec 14, 2011 at 23:49, Antoine Latter <aslatter at gmail.com> wrote:
>>
>> Or we could not use 'some' and 'many' with list and maybe :-)
>
>
> Yes, yes, we get the message, a wink and a nod is all that's needed to
> discard the nonsensical notion that types and typeclasses *mean* something.
>
That's the interesting thing about type-classes like Alternative and
Functor - they mean very little, and are used in widely varying
contexts. Heck, Control.Monad.void has the type signature "Functor f a
=> f a -> f ()" - how many functors is that operator sensible for?
There are a lot of combinators you can build from (<|>) and empty that
go terribly wrong for Maybe and List but are still quite useful. Even
the operators at hand ('many' and 'some') are partial in parsing, but
I'm not prepared to throw them out.
Antoine
More information about the Haskell-Cafe
mailing list