Show
Ignore:
Timestamp:
05/17/07 23:45:31 (18 months ago)
Author:
audreyt
Message:

* &map into a nullary block should still consume the list.

Files:
1 modified

Legend:

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

    r15616 r16384  
    335335    args  <- fromVal list 
    336336    arity <- fmap (length . subParams) (fromVal sub) 
    337     evl  <- asks envEval 
    338     vals <- mapMn args arity $ \x -> do 
     337    evl   <- asks envEval 
     338    vals  <- mapMn args arity $ \x -> do 
    339339        rv  <- local (\e -> e{ envContext = cxtSlurpyAny }) $ do 
    340340            evl (App (Val sub) Nothing (map Val x)) 
     
    344344    -- Takes a list, an arity, and a function. 
    345345    mapMn           :: [Val] -> Int -> ([Val] -> Eval [Val]) -> Eval [Val] 
     346    mapMn list 0 f   = fmap concat (mapM (const $ f []) list) 
    346347    mapMn list n f   = mapMn' (list2LoL n list) f 
    347348    -- Takes a LoL and a function and applies the function to the inputlist.