Documentation contents

Script File

generics.at

Source
atlas-scripts/generics.at (29 lines)
Definitions
11
Loads
nothing
Loaded by
none of the other all.at files

Definitions in source order

I

L3any_type S, T, RI (T x) = T

also defined in modules.at

constant

L4any_type S, T, Rconstant (T x) = (S .) T

compose

L5any_type S, T, Rcompose ((S->R) g) = ((T->S)f)

swap

L7any_type S, T, Rswap (S x,T y) = (T,S)

swapargs

L9any_type S, T, Rswapargs ((S,T->R) f) = (T y,S x) R

curry

L10any_type S, T, Rcurry ((S,T->R) f) = (S->(T->R))

uncurry

L11any_type S, T, Runcurry ((S->(T->R)) f) = (S x,T y) R

curried_swapargs

L13any_type S, T, Rcurried_swapargs ((S->(T->R)) f) = (T->(S->R))

foldl

L15any_type S, T, Rfoldl (S !start,(S,T->S) op) = ([T]->S)
rec_fun f ([T] a) S: if #a=0 then start else op(f(a[:1~]),a~[0]) fi
L17

foldr

L19any_type S, T, Rfoldr ((S,T->T) op, T !start) = ([S]->T)
rec_fun f ([S] a) T: if #a=0 then start else op(a[0],f(a[1:])) fi
L21

combine

L23any_type S, T, Rcombine ([T] a) = ((T,T->T) ->T)
like |foldl|, but nonempty only, and with swapped arguments

Generated from atlas-scripts at commit 7e1b958 (2026-09-17).