There are a few I’m aware of:

  1. Rust-style use (multiple imports per statement, renaming items using as)
  2. Java-style import (single import per statement, no renaming (afaik))
  3. Zig-style let xlib = @import("xlib") (imports as assignments)
  4. C-style #include (no importing, just pastes the code of the named file)
  • DNEAVES@lemmy.world
    link
    fedilink
    arrow-up
    8
    ·
    3 days ago

    Elm:

    -- Import under the name "List"
    import List
    
    -- Import aliased under the name "JD"
    import Json.Decode as JD
    
    -- Import Html, and put the Html type into the unqualified namespace
    import Html exposing (Html)
    
    -- Import Http, and put everything from it in the unqualified namespace
    import Http exposing (..)