Re: casting with a func. pattern

From: Wolfgang Lux <wlux_at_uni-muenster.de>
Date: Fri, 02 Feb 2007 12:06:08 +0100

Hello Sebastian!

There is no need to use function patterns here. All you need to define
cast is

   magic' :: _ -> Empty
   magic' = const failed

   cast :: Term _ -> Term Empty
   cast = rename magic'

The only advantage of using function patterns in your example is that
you can avoid the additional definition of magic' (it wouldn't have
been necessary if you had omitted the type signature for magic).

Regards
Wolfgang


_______________________________________________
curry mailing list
curry_at_lists.RWTH-Aachen.DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/curry
Received on Fr Feb 02 2007 - 13:28:37 CET

This archive was generated by hypermail 2.3.0 : Do Feb 01 2024 - 07:15:07 CET