Changeset 3569 for src/Pugs/Junc.hs

Show
Ignore:
Timestamp:
05/21/05 10:53:05 (4 years ago)
Author:
scook0
svk:copy_cache_prev:
5154
Message:

Tweaks to Haddocks for Junc.hs

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/Junc.hs

    r3565 r3569  
    6464 
    6565{-| 
    66 Check if the specified value is a 'VJunc' of one of the specified 
    67 junctive types. If it is, return it as a 'VJunc'. 
     66Check if the specified value is a 'Pugs.Internals.VJunc' of one of the specified 
     67junctive types. If it is, return it as a 'Pugs.Internals.VJunc'. 
    6868-} 
    6969juncTypeIs :: Val -- ^ Value to test 
     
    8181junction value. 
    8282 
    83 For 'JAny', values are simply collapsed into @Set@s (duplicate values are 
    84 discarded). 
    85  
    86 For 'JOne', newly-created duplicates are extracted from the combined list of 
    87 values and moved into the combined set of duplicates. 
     83For 'Pugs.Internals.JAny', values are simply collapsed into @Set@s (duplicate 
     84values are discarded). 
     85 
     86For 'Pugs.Internals.JOne', newly-created duplicates are extracted from the  
     87combined list of values and moved into the combined set of duplicates. 
    8888-} 
    8989mergeJunc :: JuncType -- ^ Type of the junctions being combined 
     
    107107Core of the \"hideously clever\" autothreading algorithm. 
    108108 
    109 This function scans through the list of 'ApplyArg's, finds any that are 
    110 uncollapsed junctions, and transposes the \'sub call with junction argument\' 
    111 into \'junction of sub calls with non-junction arguments\'. It then recursively 
    112 applies itself to each of those newly-created \'threads\', so ultimately all 
    113 the call's arguments are properly collapsed. 
     109This function scans through the list of 'ApplyArg's, finds the first 
     110uncollapsed junction, and transposes e.g. @foo($a|$b|$c)@ into 
     111@( foo($a) | foo($b) | foo($c) )@. 
     112 
     113It then recursively applies itself to each of those newly-created \'threads\',  
     114so ultimately all the call's arguments are properly collapsed. 
    114115 
    115116The scanning process will thread through @all@ and @none@ before it threads 
    116117through @any@ and @one@. 
    117118 
    118 Once all the args /are/ collapsed, we call our first argument with the final, 
    119 collapsed args. This happens once for each possible combination of (collapsed) 
    120 arguments. 
     119Once all the args /are/ collapsed, we call the (Haskell) function that  
     120'juncApply'\'s was given, passing to it the final list of collapsed args. 
     121This happens once for /each/ possible combination of (collapsed) arguments. 
     122The function is expected to perform the actual subroutine call. 
    121123 
    122124Note that 'juncApply' takes place /after/ parameter binding (because it must), 
    123 but /before/ we actually introduce any bindings into the sub's lexical scope. 
     125but /before/ we actually introduce any bindings into the sub's lexical scope 
     126(because otherwise we wouldn't know which value to bind). 
    124127-} 
    125128juncApply :: ([ApplyArg] -> Eval Val) -- ^ Function to call once we know the