Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [show] @?[~://]
- ?\ [show] @?[~:/^[^\n]*$/] For a show that doesn't allow newlines.
- [=] @?[~ ~:bool]
- [>] @?[~ ~:bool]
- [<] @?[~ ~:bool]
- [>=] @?[~ ~:bool]
- [<=] @?[~ ~:bool]
- @true?[bool]: 0 0 =
- @false?[bool]: true ~
- @id?[~t:~t]: #x x
- @drop?[~:]: #_
- @drop2?[*2:]: #_#_
- @drop3?[*3:]: #_#_#_
- @dropn?[* int:]: list drop
- @dup?[~t:~t~t]: #x x x
- @dup2?[~s~t:(~s~t)*2]: #x#y x y x y
- @dup3?[~r~s~t:(~r~s~t)*2]: #x#y#z x y z x y z
- @dupn?[* int:*]: list [..][..] bi
- @over?[~s~t:~s~t~s]: #a#b a b a
- @over2?[~r~s~t:~r~s~t~r]: #a#b#c a b c a
- @over3?[~r~s~t~u:~r~s~t~u~r]: #a#b#c#d a b c d a
- @overn?[~t * int:~t * ~t]: list [..][head] bi
- @swap?[~s~t:~t~s]: #a#b b a
- @rot?[~r~s~t:~s~t~r]: #a#b#c b c a
- @dip?[* ~t ~:* ~t]: #v#f f# v
- @dip2?[* ~s~t ~:* ~s~t]: #v#w#f f# v w
- @dip3?[* ~r~s~t ~:* ~r~s~t]: #v#w#x#f f# v w x
- @dipn?[* ~ int: *]: #f#n n list dip[f] ..
- @keep?[* ~t [* ~t:*]:* ~t]: #v#f v f# v
- @bi?[~t [~t:*]*2:*]: #v#f#g v f# v g#
- @tri?[~t [~t:*]*3:*]: #v#f#g#h v f# v g# v h#
- @curry?[~t [* ~t:*]:~]: #x#f [x f#]
- @curry2?[~s~t [* ~s~t:*]:~]: #x#y#f [x y f#]
- @curry3?[~r~s~t [* ~r~s~t:*]:~]: #x#y#z#f [x y z f#]
- @curryn?[* int:*]: times[curry]
- @compose?[~ ~:~]: #f#g [f# g#]
- @_?#_?[* bool ~ ~:*]: ? #
- @if_t?[* bool ~:*]: [] ?#
- @if_f?[* bool ~:*]: [] swap ?#
- @?ifchain
- @if?[bool ~:ifchain]: #c#f
- ?ifchain{>$b[] >$sb[=b []=sb ic]} @ic ic
- c if_t: .sb(f)
- @elseif?[ifchain bool ~:ifchain]:#f if_t: .sb(f)
- @else?[* ifchain ~:*]:#f .sb(f) .b#
- @endif?[* ifchain:*]:.b#
- !?ifchain
- @head?[{~t>}:~t]: #{x>} x
- @tail?[{>}:{>}]: #{_>xs} xs
- @top?[{<~t}:~t]: #{<x} x
- @under?[{<}:{<}]: #{xs<_} xs
- @pop?[{<~t}:{<} ~t]: #{xs<x} xs x
- @popb?[{<~t}:~t {<}]: #{xs<x} x xs
- @popn?[{<} int:{<} *]: #n n 0 > if_t: pop dip[n 1 - popn]
- @push?[{<} ~t:{<~t}]: #xs#e {xs.. e}
- @pushb?[~t {<}:{<~t}] #e#xs {xs.. e}
- @pushn?[{<} * int:{<}]:#n n 0 > if_t:dip[n 1 - pushn] push
- @append?[{*}{*}:{*}]: #a#b {a.. b..}
- @prepend?[{*}{*}:{*}]: #a#b {b.. a..}
- @loop?[+:*]: #f f# f loop
- @while?[* [bool] ~:*]: #c#f c# if_t: f# c f while
- @until?[* [bool] ~:*]: #c#f c# if_f: f# c f until
- @dowhile?[* [bool]:*]: #f f# if_t: f dowhile
- @dountil?[* [bool]:*]: #f f# if_f: f dountil
- @fix?[+:*]: #f [f fix] f#
- @times?[* int ~:*]:#n#f n 0 > if_t: f# n 1 - times(f)
- @map?[{>~t}[~t:*]:{>}]: {#{x>xs}#f x f# map(xs,f)..}#`{#_#_}#
- @each?[{>~t}[~t:*]:*]: [#{x>xs}#f x f# each(xs,f)]#`[#_#_]#
- @filter?[{>~t}[~t:bool]:{>~t}]: {#{x>xs}#p x p# if_t[x] xs p filter..}#`{#_#_}#
- @filterout?[{>~t}[~t:bool]:{>~t}]: {#{x>xs}#p x p# if_f[x] xs p filterout..}#`{#_#_}#
- @takewhile?[{>~t}[~t:bool]:{>~t}]: {#{x>xs}#p x p# if_t: x xs p takewhile..}#`{#_#_}#
- @takeuntil?[{>~t}[~t:bool]:{>~t}]: {#{x>xs}#p x p# if_f: x xs p takewhile..}#`{#_#_}#
- @leavewhile?[{>~t}[~t:bool]:{>~t}]: [#l{x>xs}#p x p# [xs p leavewhile][l]?#]#`[]#
- @leaveuntil?[{>~t}[~t:bool]:{>~t}]: [#l{x>xs}#p x p# [l][xs p leaveuntil]?#]#`[]#
- @fold?[{>~s}~t[~t~s:~t]:~t]: [#{x>xs}#e#f fold(xs, e x f#, f)]#`[#_#e#_ e]#
- @foldr?[{~s<}~t[~s~t:~t]:~t]: [#{xs<x}#e#f foldr(xs, x e f# ,f)]#`[#_#e#_ e]#
- @reduce?[{>~t}[~t~t:~t]:~t]: #{x>xs}#f xs x f fold
- @reducer?[{~t<}[~t~t:~t]:~t]: #f pop f foldr
- @scan?[{>~s}~t[~t~s:~t]:{>~t}]: {#{x>xs}#e#f @r(e x f#) r scan(xs, r, f)..}#`{#_#_#_}#
- @scanr?[{~s<}~t[~s~t:~t]:{~t<}]: {#{xs<x}#e#f @r(x e f#) scanr(xs, r, f).. r}#`{#_#_#_}#
- @spread?[{>~t}[~t~t:~t]:{>~t}]: {#{x>xs}#f x scan(xs x f)..}#`{#_#_}#
- @spreadr?[{~t<}[~t~t:~t]:{~t<}]: {#{xs<x}#f scanr(xs x f).. x}#`{#_#_}#
- @find?[{>~t}[~t:bool]:~t]: #{x>xs}#p if(x p#)[x] else: xs p find
- @forall?[{>~t}[~t:bool]:bool]: [#{x>xs}#p x p# [xs p forall][false]?#]#`[#_#_ true]#
- @exists?[{>~t}[~t:bool]:bool]: [#{x>xs}#p x p# [true][xs p exists]?#]#`[#_#_ false]#
- @dowhilefound?[{>~t}[~t:* bool]:*]: [#{x>xs}#p x p# if_t: xs p dowhilefound]#`[#_#_]#
- @dountilfound?[{>~t}[~t:* bool]:*]: [#{x>xs}#p x p# if_f: xs p dountilfound]#`[#_#_]#
- ?\ @list?[* int:{*}]:#n if(n 0 >)[#e n 1 - list e push] else{}
- @list?[* int:{*}]: #n n 0 > [dip[n 1 - list] push] {} ?#
- @count?[int:{>int}]: #n {n loop[dup 1+]}
- @countd?[int:{>int}]:#n {n loop[dup 1-]}
- @iota?[:{>int}]: #n count(0) below(n)
- @box?[~t:{$~t}]:#v {r v $r}
- @array?[{~t*}:{$~t*}]:{#{v>vs} r v $r vs array..}#`{#_}#
- @rev?[{>}:{<}]: {#{x>xs} xs rev.. x}#`{#_}#
- @revb?[{<}:{>}]: {#{xs<x} x xs rev..}#`{#_}#
- @cycle?[{>}:{>}]: #l {l cycle.. l..}
- @cycleb?[{<}:{<}]: #l {l.. l cycle..}
- @reps?[int {>}:{>}]: #n#s {n times: s..}
- @string?[int ~t:{>~t}]: #n#c {n times: c}
- @step?[{>}:{>}]: {#l{x>}#n x (l n leave) n step..}#`{#l{x>}#_ x}#`{#_#_}#
- @sum?[{>_+_}:_+_]: reduce[+]
- @length?[{>}:int]: map[#_ 1] sum
- @product?[{>_*_}:_*_]: reduce[*]
- ?\ Exemplar @max?[[~ ~:bool]@_>_ {>_>_}:_>_]: reduce[#a#b a b > a b ?]
- @max?[{>_>_}:_>_]: reduce[#a#b a b > a b ?]
- @min?[{>_<_}:_<_]: reduce[#a#b a b < a b ?]
- @findmax?[{>~t}[~t:_>_]:_>_]: map max
- @findmin?[{>~t}[~t:_<_]:_<_]: map min
- @cat?[{>{*}}:{>}]: map[..]
- @showcat?[{>_show_}://]: map[.show..]
- @catlines?[{//*}://]: map[.. '\n']
- @take?[{>} int:{>}]: #n n 0 > {#{x>xs} x xs n 1 - take..} {#_} ?#
- @leave?[{>} int:{>}]: times[tail]
- @topn?[{<} int:*]: #n ift(n 0 >): pop dip[n 1 - topn]
- @undern?[{<} int:{<}]: times[under]
- @upto?[{>_>_} int:{>_>_}]: #n takeuntil[n >]
- @downto?[{>_<_} int:{>_<_}]: #n takeuntil[n <]
- @upfrom?[{>_<_} int:{>_<_}]: #n leavewhile[n <]
- @downfrom?[{>_>_} int:{>_>_}]: #n leavewhile[n >]
- @above?[{>_>_} int:{>_>_}]: #n takewhile[n >]
- @below?[{>_<_} int:{>_<_}]: #n takewhile[n <]
- @fromabove?[{>_>_} int:{>_>_}]: #n leaveuntil[n >]
- @frombelow?[{>_<_} int:{>_<_}]: #n leaveuntil[n <]
- @zip?[{>{>}}:{>{>}}]: {#l l map[head], l map[tail] zip..}#`{#_}#
- @transpose?[{>{>}}:{>{>}}]: filterout[{}=] {#l{_>} l map[head], l map[tail] transpose..}#`{#_}#
- @zipwith?[{>}* ~:{>}]: #f zip map[.. f#]
- @match?[_=_*2:_=_]: over = if_t: `
Add Comment
Please, Sign In to add comment