[Haskell-cafe] Plain lambda inside banana brackets in the arrow notation
Tsuyoshi Ito
tsuyoshi.ito.2006 at gmail.com
Sun Jul 15 19:51:07 CEST 2012
On Fri, Jul 13, 2012 at 8:11 AM, Ross Paterson <ross at soi.city.ac.uk> wrote:
> On Thu, Jul 12, 2012 at 02:47:57PM +0100, Ross Paterson wrote:
>> Though one possibility that might get
>> us most of the way there would be to refactor the Arrow class as
>>
>> class PreArrow a where
>> premap :: (b -> b') -> a b' c -> a b c
>>
>> class (Category a, PreArrow a) => Arrow a where
>> arr :: (b -> c) -> a b c
>> arr f = premap f id
>>
>> first :: a b c -> a (b,d) (c,d)
>
> I've done this and the associated GHC changes locally; it yields a simple
> rule for determining which instances are needed, based on the keywords used:
>
> * all commands ("proc" and operator arguments) need PreArrow
> * "do" needs Arrow
> * "rec" needs ArrowLoop
> * "case" or "if" need ArrowChoice
>
> I'm warming to it as a worthwhile generalization (though not exactly what
> was asked for).
Thank you for the response. This sounds exciting, but sadly, I must
admit that it is a little (?) above my head, and I cannot relate this
extension to my original question….
Best regards,
Tsuyoshi
More information about the Haskell-Cafe
mailing list