[Haskell-cafe] how do I avoid excessive constructor application?
S. Alexander Jacobson
alex at alexjacobson.com
Wed Mar 2 10:02:19 EST 2005
I'd like to do this sort of thing with types other than Either.
Is there a generic safe coerce function?
-Alex-
On Wed, 2 Mar 2005, Stefan Holdermans wrote:
> Lemmih,
>
>> And you can "fix" it with some unsafeCoerce# magic. (:
>
> Actually, as I pointed out, the required coercion in perfectly safe, though
> not implicit:
>
> coerceRight :: Either a b -> Either c b
> coerceRight (Right b) = Right b
>
> Regards,
>
> Stefan
>
______________________________________________________________
S. Alexander Jacobson tel:917-770-6565 http://alexjacobson.com
More information about the Haskell-Cafe
mailing list