Ignore:
Timestamp:
May 2, 2014, 3:10:50 PM (11 years ago)
Author:
gobi
Message:

operators

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sizechecking/branches/macs/tests/LambdaTest.hs

    r20 r21  
    11{-# LANGUAGE NoMonomorphismRestriction #-} 
    22 
     3module Tests.LambdaTest where 
     4 
    35import Lambda 
    4 import Ops 
    5 import Prelude ( ($), Int ) 
     6import Prelude ( ($), Int, (==), return, sequence, (>>=), and, (.), IO, Bool ) 
     7import qualified Control.Monad 
    68 
    79test1 :: (Lambda l) => l Int 
    810test1 = app (lam $ \_ -> const 3) (const 2) 
    911 
     12test1ast :: IO Bool 
     13test1ast = do 
     14    t <- ast test1 
     15    return $ t "" == "(λa.3) 2" 
    1016 
     17test1eval :: IO Bool 
     18test1eval = return $ eval test1 == 3 
     19 
     20tests :: [IO Bool] 
     21tests = [  
     22      test1ast 
     23    , test1eval 
     24    ] 
     25 
     26runTests :: IO Bool 
     27runTests = Control.Monad.liftM and $ sequence tests 
Note: See TracChangeset for help on using the changeset viewer.