Changeset 10
- Timestamp:
- Nov 14, 2012, 8:45:28 PM (13 years ago)
- Files:
-
- 2 added
- 1 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
sizechecking/Examples.hs
r5 r10 210 210 comp :: (SizedExp se) => Size se ( (b->c) -> (a->b) -> a->c ) 211 211 comp = bind comps $ \f g x -> f `app` (g `app` x) 212 213 test1s = Abs 2 $ AAbs 19 6 $ (Var 2) `App` (List (Var 19) (Var 6)) 214 test1 :: (SizedExp se) => Size se (([a] -> [b]) -> [a] -> [b]) 215 test1 = bind test1s $ \f l -> match (f `app` l) nil (\x xs -> f `app` l) 216 217 218 test2s = Abs 2 $ AAbs 18 5 $ appends `App` (Var 2 `App` (List (Var 18) (Var 5))) `App` (List (Var 18) (Var 5)) 219 test2 :: (SizedExp se) => Size se (([a] -> [a]) -> [a] -> [a]) 220 test2 = bind test2s $ \f l -> append `app` (f `app` l) `app` l 212 221 213 222 data TestCase = forall a . TestCase P.String (forall se. SizedExp se => Size se a) -
sizechecking_branches/L.hs
r9 r10 1 {-# Language GADTs, FlexibleInstances, FlexibleContexts, MultiParamTypeClasses, FunctionalDependencies, ScopedTypeVariables, TypeFamilies, NoMonomorphismRestriction #-} 1 {-# Language GADTs, FlexibleInstances, FlexibleContexts, MultiParamTypeClasses, FunctionalDependencies, ScopedTypeVariables, TypeFamilies, NoMonomorphismRestriction, OverlappingInstances #-} 2 module L where 2 3 3 4 import Data.Char(ord, chr) … … 11 12 {- Lambda calculus without free variables -} 12 13 type Arr repr a b = repr a -> repr b 13 --type family Arr (repr :: * -> *) (a :: *) (b :: *) :: *14 14 15 15 class Lambda l where … … 26 26 undef :: l Bottom 27 27 unsized :: l () 28 29 instance Lambda l => Show (l a) where 30 showsPrec _ e = error "Error: no show" 31 32 instance Lambda l => Eq (l a) where 33 (==) _ _ = error "Error: no eq" 28 34 29 35 instance Lambda l => Num (l Int) where
Note: See TracChangeset
for help on using the changeset viewer.