On Fri, Jul 13, 2012 at 8:11 AM, Ross Paterson <[email protected]> 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

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to