Re: from static typing to runtime constraints

From: Sergio Antoy <antoy_at_redstar.cs.pdx.edu>
Date: Fri, 08 Dec 2006 10:55:55 -0800 (PST)

Sebastian,

Below is another technique, in addition to Bernd's, to simulate
the run (I call it need) time choice semantics. Probably, it is
less efficient. Runs under pakcs.

Cheers,
Sergio

    
    getAllValues x = findall (=:= x)
    chooseValue (u:v) = u ? chooseValue v
    
    data Color = Red | Green
    Color = Red ? Green
    data Tree a = Leaf | Node a (Tree a) (Tree a)
    Tree a = Leaf ? Node (chooseValue b) (Tree a) (Tree a)
           where b = getAllValues a
    
    test = Node Red (Node Green Leaf Leaf) Leaf =:= Tree Color
    

_______________________________________________
curry mailing list
curry_at_lists.RWTH-Aachen.DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/curry
Received on Mo Dez 11 2006 - 10:15:52 CET

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