Re: casting with a func. pattern

From: Wolfgang Lux <>
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).


curry mailing list
Received on Fr Feb 02 2007 - 13:28:37 CET

This archive was generated by hypermail 2.3.0 : Mo Dez 04 2023 - 07:15:09 CET