Nushell
Get Nu!
Getting Started
  • The Nushell Book
  • Command Reference
  • Cookbook
  • Language Reference Guide
  • Contributing Guide
Blog
  • English
  • 中文
  • Deutsch
  • Français
  • Español
  • 日本語
  • Português do Brasil
  • Русский язык
  • 한국어
GitHub
Get Nu!
Getting Started
  • The Nushell Book
  • Command Reference
  • Cookbook
  • Language Reference Guide
  • Contributing Guide
Blog
  • English
  • 中文
  • Deutsch
  • Français
  • Español
  • 日本語
  • Português do Brasil
  • Русский язык
  • 한국어
GitHub
  • Language Reference Guide
    • Readme
    • Types in the Nu Language
      • Basic Types
        • Any
        • Boolean
        • Integer
        • Float
        • Filesize
        • Duration
        • Datetime
        • Range
        • String
        • Record
        • List
        • Table
        • Closure
        • Nothing
        • Binary
        • Glob
        • Cell-Path
      • Other Data Types

        • Types used only in command signatures
          • Path
        • Types which are not declarable
          • Error
          • CustomValue
          • Block
      • Type signatures
      • Commands that interact with types
    • Operators
    • Flow control
      • if/else
      • loop
      • while
      • match
      • try/catch
      • break
      • return
      • continue
    • Filters
      • each and par-each
      • Filters to select subsets of data
      • where and filter
      • Understanding the difference between get and select
    • Custom Commands
    • Declarations
    • Variable Scope
    • Strings and Text Formatting
    • Helpers and debugging commands
    • Pipelines
    • MIME Types for Nushell

Types that are not declarable by the user

The following are valid Nushell data types which cannot be declared by the user. They are used by Nushell internally or by plugins or commands compiled in Nushell like Polars and SQLite database.

Besides error values and blocks (see their pages), this group includes custom values such as semver and semver-range (from into semver and into semver-range), matrix (from into matrix), SQLiteDatabase (from open on a SQLite file or stor open), and Polars objects such as polars_dataframe. describe reports their names, but a name like semver cannot be used as a type annotation:

let v: semver = ("1.2.3" | into semver)
# => Error: nu::parser::unknown_type
# =>
# =>   × Unknown type.
# =>    ╭─[repl_entry #1:1:8]
# =>  1 │ let v: semver = ("1.2.3" | into semver)
# =>    ·        ───┬──
# =>    ·           ╰── unknown type
# =>    ╰────

Leave such a variable or parameter unannotated, or annotate it as any.

Edit this page on GitHub
Contributors: NotTheDr01ds, fdncred
Prev
Types used only in command signatures