
On Tue, 22 Mar 2011 10:14:57 +0100, Henk-Jan van Tuyl
On Tue, 22 Mar 2011 08:56:45 +0100, Petr Novotnik
wrote: data Person = Person { personName :: String , personAge :: Int } deriving (Show)
exampleExpr :: Bool exampleExpr = (VConst 99) .==. (VFunc personAge) $ Person "pete" 99
I was wondering, whether it'd be possible to enable defining expression without the Value data constructors, i.e.
99 .==. personAge $ Person "pete" 99
You can write: 99 == personAge (Person "pete" 99)
Or you could write: c .==. f = \x -> c == f x test = 99 .==. personAge $ Person "pete" 99 The .==. operator is not symmetrical in this case, of course Regards, Henk-Jan van Tuyl -- http://Van.Tuyl.eu/ http://members.chello.nl/hjgtuyl/tourdemonad.html --