Show
Ignore:
Timestamp:
12/21/06 04:43:12 (2 years ago)
Author:
luqui
Message:

Implemented XX (but not the metaoperator).

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/Prim/List.hs

    r14927 r14933  
    22 
    33module Pugs.Prim.List ( 
    4     op0Zip, op0Cat, op0Each, op0RoundRobin, op1Pick, op1Sum, 
     4    op0Zip, op0Cross, op0Cat, op0Each, op0RoundRobin, op1Pick, op1Sum, 
    55    op1Min, op1Max, op1Uniq, 
    66    op2Pick, 
     
    3838    zipRest  []     = [] 
    3939    zipRest  (_:xs) = xs 
     40 
     41op0Cross :: [Val] -> Eval Val 
     42op0Cross = fmap (VList . fmap VList . op0Cross') . mapM fromVal 
     43 
     44op0Cross' :: [[Val]] -> [[Val]] 
     45op0Cross' [] = [[]] 
     46op0Cross' (xs:yss) = do 
     47    x <- xs 
     48    ys <- op0Cross' yss 
     49    return (x:ys) 
    4050 
    4151op1Pick :: Val -> Eval Val