USING: accessors arrays effects fry generalizations kernel
macros math math.order sequences sequences.generalizations
stack-checker stack-checker.backend stack-checker.errors
-stack-checker.values stack-checker.visitor words memoize ;
+stack-checker.values stack-checker.visitor words memoize
+combinators ;
IN: combinators.smart
GENERIC: infer-known* ( known -- effect )
: output>array ( quot -- array )
{ } output>sequence ; inline
+
+: cleave>array ( x seq -- array )
+ '[ _ cleave ] output>array ; inline
: input<sequence ( seq quot -- )
[ inputs firstn ] [ call ] bi ; inline
class-partition boa ;
: class-partition>sequence ( class-partition -- seq )
- [
- {
- [ integers>> ]
- [ not-integers>> ]
- [ simples>> ]
- [ not-simples>> ]
- [ and>> ]
- [ or>> ]
- [ other>> ]
- } cleave
- ] output>array concat ;
+ {
+ [ integers>> ]
+ [ not-integers>> ]
+ [ simples>> ]
+ [ not-simples>> ]
+ [ and>> ]
+ [ or>> ]
+ [ other>> ]
+ } cleave>array concat ;
: repartition ( partition -- partition' )
! This could be made more efficient; only and and or are effected