# This file is a part of Julia. License is MIT: https://julialang.org/license

# Re-exports from `Core`
export Core,
    # key types
    Any, TypeEq, DataType, Vararg, NTuple,
    Tuple, Type, UnionAll, TypeVar, Union, Nothing, Cvoid,
    AbstractArray, DenseArray, NamedTuple, Pair,
    # special objects
    Function, Method, Module, Symbol, Task, UndefInitializer, undef, WeakRef, VecElement,
    Array, Memory, MemoryRef, AtomicMemory, AtomicMemoryRef, GenericMemory, GenericMemoryRef,
    # numeric types
    Number, Real, Integer, Bool, Ref, Ptr,
    AbstractFloat, Float16, Float32, Float64,
    Signed, Int, Int8, Int16, Int32, Int64, Int128,
    Unsigned, UInt, UInt8, UInt16, UInt32, UInt64, UInt128,
    # string types
    AbstractChar, Char, AbstractString, String, IO,
    # errors
    ErrorException, BoundsError, DivideError, DomainError, Exception,
    InterruptException, InexactError, OutOfMemoryError, ReadOnlyMemoryError,
    OverflowError, StackOverflowError, SegmentationFault, UndefRefError, UndefVarError,
    TypeError, ArgumentError, MethodError, AssertionError, LoadError, InitError,
    UndefKeywordError, ConcurrencyViolationError, FieldError,
    # AST representation
    Expr, QuoteNode, LineNumberNode, GlobalRef,
    # object model functions
    fieldtype, getfield, setfield!, swapfield!, modifyfield!, replacefield!, setfieldonce!,
    nfields, throw, tuple, ===, isdefined,
    # access to globals
    getglobal, setglobal!, swapglobal!, modifyglobal!, replaceglobal!, setglobalonce!, isdefinedglobal,
    # ifelse, sizeof    # not exported, to avoid conflicting with Base
    # type reflection
    <:, typeof, isa, typeassert,
    # method reflection
    applicable, invoke,
    # constants
    nothing, Main,
    # backwards compatibility
    arrayref, arrayset, arraysize, const_arrayref

export
# Modules
    Meta,
    StackTraces,
    Sys,
    Libc,
    Docs,
    Threads,
    Iterators,
    Broadcast,
    MathConstants,

# Types
    AbstractChannel,
    AbstractIrrational,
    AbstractMatrix,
    AbstractRange,
    AbstractSet,
    AbstractSlices,
    AbstractUnitRange,
    AbstractVector,
    AbstractVecOrMat,
    Array,
    AbstractMatch,
    AbstractPattern,
    AbstractDict,
    BigFloat,
    BigInt,
    BitArray,
    BitMatrix,
    BitVector,
    CartesianIndex,
    CartesianIndices,
    LinearIndices,
    Channel,
    Cmd,
    Colon,
    Complex,
    ComplexF64,
    ComplexF32,
    ComplexF16,
    ComposedFunction,
    ColumnSlices,
    DenseMatrix,
    DenseVecOrMat,
    DenseVector,
    Dict,
    Dims,
    Enum,
    ExponentialBackOff,
    IndexCartesian,
    IndexLinear,
    IndexStyle,
    InsertionSort,
    BitSet,
    IOBuffer,
    IOStream,
    LinRange,
    Lockable,
    Irrational,
    LazyString,
    Matrix,
    MergeSort,
    Missing,
    NTuple,
    IdDict,
    IdSet,
    OrdinalRange,
    Pair,
    PartialQuickSort,
    OncePerProcess,
    OncePerTask,
    OncePerThread,
    PermutedDimsArray,
    QuickSort,
    Rational,
    Regex,
    RegexMatch,
    Returns,
    RoundFromZero,
    RoundDown,
    RoundingMode,
    RoundNearest,
    RoundNearestTiesAway,
    RoundNearestTiesUp,
    RoundToZero,
    RoundUp,
    RowSlices,
    Set,
    Some,
    Slices,
    StepRange,
    StepRangeLen,
    StridedArray,
    StridedMatrix,
    StridedVecOrMat,
    StridedVector,
    SubArray,
    SubString,
    StringView,
    SubstitutionString,
    Timer,
    UnitRange,
    Val,
    VecOrMat,
    Vector,
    VersionNumber,
    WeakKeyDict,

# Ccall types
    Cchar,
    Cdouble,
    Cfloat,
    Cint,
    Cintmax_t,
    Clong,
    Clonglong,
    Cptrdiff_t,
    Cshort,
    Csize_t,
    Cssize_t,
    Cuchar,
    Cuint,
    Cuintmax_t,
    Culong,
    Culonglong,
    Cushort,
    Cwchar_t,
    Cstring,
    Cwstring,

# Exceptions
    CanonicalIndexError,
    CapturedException,
    CompositeException,
    DimensionMismatch,
    EOFError,
    InvalidStateException,
    KeyError,
    MissingException,
    ProcessFailedException,
    TaskFailedException,
    SystemError,
    StringIndexError,

# Global constants and variables
    ARGS,
    C_NULL,
    DEPOT_PATH,
    ENDIAN_BOM,
    ENV,
    LOAD_PATH,
    PROGRAM_FILE,
    stderr,
    stdin,
    stdout,
    VERSION,
    devnull,

# Mathematical constants
    Inf,
    Inf16,
    Inf32,
    Inf64,
    NaN,
    NaN16,
    NaN32,
    NaN64,
    im,
    π, pi,
    ℯ,

# Operators
    !,
    !=,
    ≠,
    !==,
    ≡,
    ≢,
    xor,
    ⊻,
    nand,
    nor,
    ⊼,
    ⊽,
    %,
    ÷,
    &,
    *,
    *%,
    +,
    +%,
    -,
    -%,
    /,
    //,
    <,
    <:,
    <<,
    <=,
    ≤,
    ==,
    >,
    >:,
    >=,
    ≥,
    >>,
    >>>,
    \,
    ^,
    |,
    |>,
    ~,
    :,
    =>,
    ∘,

# scalar math
    @evalpoly,
    evalpoly,
    abs,
    abs2,
    acos,
    acosd,
    acosh,
    acot,
    acotd,
    acoth,
    acsc,
    acscd,
    acsch,
    angle,
    asec,
    asecd,
    asech,
    asin,
    asind,
    asinh,
    atan,
    atand,
    atanh,
    big,
    binomial,
    bitreverse,
    bitrotate,
    bswap,
    cbrt,
    fourthroot,
    ceil,
    cis,
    cispi,
    clamp,
    cld,
    cmp,
    complex,
    conj,
    copysign,
    cos,
    cosc,
    cosd,
    cosh,
    cospi,
    cot,
    cotd,
    coth,
    count_ones,
    count_zeros,
    csc,
    cscd,
    csch,
    deg2rad,
    denominator,
    div,
    divrem,
    eps,
    exp,
    exp10,
    exp2,
    expm1,
    exponent,
    factorial,
    fld,
    fld1,
    fldmod,
    fldmod1,
    cldmod1,
    flipsign,
    float,
    tryparse,
    floor,
    fma,
    frexp,
    gcd,
    gcdx,
    hypot,
    imag,
    inv,
    invmod,
    isapprox,
    iseven,
    isfinite,
    isinf,
    isinteger,
    isnan,
    isnegative,
    isodd,
    ispositive,
    ispow2,
    isqrt,
    isreal,
    issubnormal,
    iszero,
    isone,
    lcm,
    ldexp,
    leading_ones,
    leading_zeros,
    log,
    log10,
    log1p,
    log2,
    maxintfloat,
    mod,
    mod1,
    modf,
    mod2pi,
    muladd,
    nextfloat,
    nextpow,
    nextprod,
    numerator,
    one,
    oneunit,
    powermod,
    prevfloat,
    prevpow,
    rad2deg,
    rationalize,
    real,
    floatmax,
    floatmin,
    reim,
    reinterpret,
    rem,
    rem2pi,
    round,
    sec,
    secd,
    sech,
    sign,
    signbit,
    signed,
    significand,
    sin,
    sinc,
    sincos,
    sincosd,
    sincospi,
    sind,
    sinh,
    sinpi,
    sqrt,
    tan,
    tand,
    tanh,
    tanpi,
    trailing_ones,
    trailing_zeros,
    trunc,
    unsafe_trunc,
    typemax,
    typemin,
    unsigned,
    widemul,
    zero,
    √,
    ∛,
    ∜,
    ≈,
    ≉,

# arrays
    axes,
    broadcast!,
    broadcast,
    cat,
    checkbounds,
    checkindex,
    circcopy!,
    circshift,
    circshift!,
    clamp!,
    conj!,
    copy!,
    copyto!,
    diff,
    cumprod,
    cumprod!,
    cumsum,
    cumsum!,
    accumulate,
    accumulate!,
    eachcol,
    eachindex,
    eachrow,
    eachslice,
    extrema!,
    extrema,
    fill!,
    fill,
    first,
    hcat,
    hvcat,
    hvncat,
    indexin,
    argmax,
    argmin,
    insertdims,
    invperm,
    invpermute!,
    isassigned,
    isperm,
    issorted,
    last,
    logrange,
    mapslices,
    max,
    maximum!,
    maximum,
    min,
    minimum!,
    minimum,
    minmax,
    ndims,
    ones,
    parent,
    parentindices,
    partialsort,
    partialsort!,
    partialsortperm,
    partialsortperm!,
    permute!,
    permutedims,
    permutedims!,
    prod!,
    prod,
    promote_shape,
    range,
    reshape,
    reverse!,
    reverse,
    rot180,
    rotl90,
    rotr90,
    size,
    selectdim,
    sort!,
    sort,
    sortperm,
    sortperm!,
    sortslices,
    dropdims,
    stack,
    step,
    stride,
    strides,
    sum!,
    sum,
    to_indices,
    vcat,
    vec,
    view,
    zeros,

# search, find, match and related functions
    contains,
    eachmatch,
    endswith,
    findall,
    findfirst,
    findlast,
    findmax,
    findmin,
    findmin!,
    findmax!,
    findnext,
    findprev,
    match,
    occursin,
    searchsorted,
    searchsortedfirst,
    searchsortedlast,
    insorted,
    startswith,

# linear algebra
    var"'", # to enable syntax a' for adjoint
    adjoint,
    transpose,
    kron,
    kron!,

# bitarrays
    falses,
    trues,

# dequeues
    append!,
    insert!,
    pop!,
    popat!,
    prepend!,
    push!,
    resize!,
    popfirst!,
    pushfirst!,

# collections
    all!,
    all,
    allequal,
    allunique,
    any!,
    any,
    firstindex,
    collect,
    count!,
    count,
    delete!,
    deleteat!,
    keepat!,
    eltype,
    empty!,
    empty,
    lastindex,
    filter!,
    filter,
    foldl,
    foldr,
    foreach,
    get,
    get!,
    getindex,
    getkey,
    haskey,
    in,
    in!,
    intersect!,
    intersect,
    isdisjoint,
    isempty,
    issubset,
    issetequal,
    keys,
    keytype,
    length,
    map!,
    map,
    mapfoldl,
    mapfoldr,
    mapreduce,
    memoryref,
    merge!,
    mergewith!,
    merge,
    mergewith,
    pairs,
    reduce,
    setdiff!,
    setdiff,
    setindex!,
    similar,
    sizehint!,
    splice!,
    symdiff!,
    symdiff,
    union!,
    union,
    unique!,
    unique,
    values,
    valtype,
    ∈,
    ∉,
    ∋,
    ∌,
    ⊆,
    ⊈,
    ⊊,
    ⊇,
    ⊉,
    ⊋,
    ∩,
    ∪,

# strings
    ascii,
    bitstring,
    bytes2hex,
    chomp,
    chop,
    chopprefix,
    chopsuffix,
    codepoint,
    codeunit,
    codeunits,
    ctruncate,
    digits,
    digits!,
    eachsplit,
    eachrsplit,
    escape_string,
    hex2bytes,
    hex2bytes!,
    isascii,
    iscntrl,
    isdigit,
    isletter,
    islowercase,
    isnumeric,
    isprint,
    ispunct,
    isspace,
    isuppercase,
    isxdigit,
    lowercase,
    lowercasefirst,
    isvalid,
    join,
    lpad,
    lstrip,
    ltruncate,
    ncodeunits,
    ndigits,
    nextind,
    prevind,
    repeat,
    replace,
    replace!,
    repr,
    reverseind,
    rpad,
    rsplit,
    rstrip,
    rtruncate,
    split,
    string,
    strip,
    takestring!,
    textwidth,
    thisind,
    titlecase,
    transcode,
    unescape_string,
    uppercase,
    uppercasefirst,

# text output
    IOContext,
    displaysize,
    dump,
    print,
    println,
    printstyled,
    show,
    showerror,
    sprint,
    summary,

# logging
    @debug,
    @info,
    @warn,
    @error,

# bigfloat & precision
    precision,
    rounding,
    setprecision,
    setrounding,
    get_zero_subnormals,
    set_zero_subnormals,

# iteration
    iterate,
    enumerate,  # re-exported from Iterators
    zip,
    only,

# object identity and equality
    copy,
    deepcopy,
    hash,
    identity,
    isbits,
    isequal,
    ismutable,
    ismutabletype,
    isless,
    isunordered,
    ifelse,
    objectid,
    sizeof,

# tasks and conditions
    Condition,
    current_task,
    islocked,
    istaskdone,
    istaskstarted,
    istaskfailed,
    lock,
    @lock,
    notify,
    ReentrantLock,
    schedule,
    task_local_storage,
    trylock,
    unlock,
    yield,
    yieldto,
    wait,
    waitany,
    waitall,
    timedwait,
    asyncmap,
    asyncmap!,
    errormonitor,

# channels
    take!,
    put!,
    isfull,
    isready,
    fetch,
    bind,

# missing values
    coalesce,
    @coalesce,
    ismissing,
    missing,
    skipmissing,
    @something,
    something,
    isnothing,
    nonmissingtype,

# time
    sleep,
    time,
    time_ns,

# errors
    backtrace,
    catch_backtrace,
    current_exceptions,
    error,
    rethrow,
    retry,
    systemerror,

# stack traces
    stacktrace,

# types
    convert,
    getproperty,
    setproperty!,
    swapproperty!,
    modifyproperty!,
    replaceproperty!,
    setpropertyonce!,
    fieldoffset,
    fieldname,
    fieldnames,
    fieldindex,
    fieldcount,
    fieldtypes,
    hasfield,
    propertynames,
    hasproperty,
    isabstracttype,
    isbitstype,
    isprimitivetype,
    isstructtype,
    isconcretetype,
    isdispatchtuple,
    oftype,
    promote,
    promote_rule,
    promote_type,
    instances,
    supertype,
    typeintersect,
    typejoin,
    widen,

# syntax
    esc,
    gensym,
    @kwdef,
    macroexpand,
    macroexpand!,
    @macroexpand1,
    @macroexpand,
    parse,

# help and reflection
    code_typed,
    code_lowered,
    fullname,
    functionloc,
    isconst,
    isinteractive,
    hasmethod,
    methods,
    nameof,
    parentmodule,
    pathof,
    pkgdir,
    pkgversion,
    names,
    which,
    @isdefined,
    @invoke,
    invokelatest,
    @invokelatest,
    @world,

# loading source files
    __precompile__,
    evalfile,
    include_string,
    include_dependency,

# RTS internals
    GC,
    finalizer,
    finalize,
    precompile,

# misc
    atexit,
    atreplinit,
    exit,
    ntuple,
    splat,
    tap,

# I/O and events
    close,
    closewrite,
    countlines,
    DirEntry,
    eachline,
    readeach,
    eof,
    fd,
    fdio,
    flush,
    gethostname,
    htol,
    hton,
    ismarked,
    isopen,
    isreadonly,
    ltoh,
    mark,
    bytesavailable,
    ntoh,
    open,
    peek,
    pipeline,
    Pipe,
    PipeBuffer,
    position,
    RawFD,
    read,
    read!,
    readavailable,
    readbytes!,
    readchomp,
    readdir,
    readline,
    readlines,
    readuntil,
    copyuntil,
    copyline,
    redirect_stdio,
    redirect_stderr,
    redirect_stdin,
    redirect_stdout,
    reset,
    seek,
    seekend,
    seekstart,
    skip,
    skipchars,
    take!,
    truncate,
    unmark,
    unsafe_read,
    unsafe_write,
    write,
    writepartial,

# multimedia I/O
    AbstractDisplay,
    display,
    displayable,
    TextDisplay,
    istextmime,
    MIME,
    @MIME_str,
    popdisplay,
    pushdisplay,
    redisplay,
    showable,
    HTML,
    Text,

# paths and file names
    abspath,
    basename,
    dirname,
    expanduser,
    contractuser,
    homedir,
    isabspath,
    isdirpath,
    joinpath,
    normpath,
    realpath,
    relpath,
    splitdir,
    splitdrive,
    splitext,
    splitpath,

# filesystem operations
    cd,
    chmod,
    chown,
    cp,
    ctime,
    diskstat,
    download,
    filemode,
    filesize,
    gperm,
    hardlink,
    isblockdev,
    ischardev,
    isdir,
    isexecutable,
    isfifo,
    isfile,
    islink,
    ismount,
    ispath,
    isreadable,
    issetgid,
    issetuid,
    issocket,
    issticky,
    iswritable,
    lstat,
    mkdir,
    mkpath,
    mktemp,
    mktempdir,
    mtime,
    mv,
    operm,
    pwd,
    readlink,
    rm,
    samefile,
    stat,
    symlink,
    tempdir,
    tempname,
    touch,
    uperm,
    walkdir,

# external processes
    detach,
    getpid,
    ignorestatus,
    kill,
    process_exited,
    process_running,
    run,
    setenv,
    addenv,
    setcpuaffinity,
    setuid,
    setgid,
    success,
    withenv,

# C interface
    @cfunction,
    @ccall,
    cglobal,
    disable_sigint,
    pointer,
    pointer_from_objref,
    unsafe_wrap,
    unsafe_string,
    reenable_sigint,
    unsafe_copyto!,
    unsafe_load,
    unsafe_modify!,
    unsafe_pointer_to_objref,
    unsafe_replace!,
    unsafe_store!,
    unsafe_swap!,

# implemented in Random module
    rand,
    randn,

# Macros
    # parser internal
    @__FILE__,
    @__DIR__,
    @__LINE__,
    @__MODULE__,
    @__FUNCTION__,
    @int128_str,
    @uint128_str,
    @big_str,
    @cmd,    # `commands`

    # notation for certain types
    @b_str,    # byte vector
    @r_str,    # regex
    @s_str,    # regex substitution string
    @v_str,    # version number
    @raw_str,  # raw string with no interpolation/unescaping
    @NamedTuple,
    @Kwargs,
    @lazy_str, # lazy string

    # documentation
    @text_str,
    @html_str,
    @doc,

    # output
    @show,

    # profiling
    @time,
    @showtime,
    @timed,
    @timev,
    @elapsed,
    @allocated,
    @allocations,
    @lock_conflicts,

    # tasks
    @sync,
    @async,
    @task,
    @threadcall,

    # metaprogramming utilities
    @generated,
    @gensym,
    @eval,
    @deprecate,

    # performance annotations
    @boundscheck,
    @inbounds,
    @fastmath,
    @simd,
    @inline,
    @noinline,
    @nospecialize,
    @specialize,
    @polly,

    @assert,
    @atomic,
    @atomicswap,
    @atomicreplace,
    @atomiconce,
    @__dot__,
    @enum,
    @label,
    @goto,
    @view,
    @views,
    @static,

    @main
