diff --git a/app/Parsing/Types.hs b/app/Parsing/Types.hs index 05f8ccb..d0a3f28 100644 --- a/app/Parsing/Types.hs +++ b/app/Parsing/Types.hs @@ -15,6 +15,7 @@ data BasicTypes | DTTDict BasicTypes BasicTypes | DTTList [BasicTypes] | DTTNullable BasicTypes + | DTTNull -- Not _Normally_ Encodable | DTTSet [BasicTypes] | DTTTuple1 BasicTypes diff --git a/docs/datatyletool_types.md b/docs/datatyletool_types.md new file mode 100644 index 0000000..0960bcb --- /dev/null +++ b/docs/datatyletool_types.md @@ -0,0 +1,43 @@ +Here are a list of basic types you can use in your `*.type` files: + +- Str + - The basic string type. + +- Int + - The basic integer type. + +- Float + - The basic float type. + +- Bool + - The basic boolean type. + +- Nullable a + - Defines an Option/Maybe type. Denotes that this value _can_ be Null/Nil/None/Nothing, or Some/Just a type. + - Must be supplied one type for the case where this value is Some/Just. + - It's internally treated an `enum`, so the members `NotNull a` and `Null` may be used as values/defaults for things like `constants` or `models`. + +- Dict a b + - The dictionary/object/map type. + - Must be supplied two types for the keys and values. + +- List a + - The list/array type. + - Must be supplied one type for each value, and they must be of the same type + +- Set a + - The set type + - Must be supplied one type for each value, and they must be of the same type + +- Tuple + - Comes in 5 flavors: + - Tuple1 + - Tuple2 + - Tuple3 + - Tuple4 + - Tuple5 + - Must be supplied a quantity of types equal to the number on the tuple, for the type of that value. + +- Any type you've defined in a `*.type` file. + - It would only make sense that anything you've defined as a type could be used as a type. + - This includes in other `*.type` files too, you'll just need a `ref`-erence to that file so we know to generate import statements when we generate the resulting file(s) \ No newline at end of file diff --git a/docs/datatypetool_cli.md b/docs/datatypetool_cli.md index c6c92f1..8332fc4 100644 --- a/docs/datatypetool_cli.md +++ b/docs/datatypetool_cli.md @@ -10,9 +10,9 @@ Here is the help message: datatypetool.toml file and creates types for all specified languages from a set of *.type files. -Available options: - -t,--toml FILE A datatypetool.toml file path, if not within the - current working directory - -v Increase verbosity, up to three times - --version Show version information - -h,--help Show this help text \ No newline at end of file + Available options: + -t,--toml FILE A datatypetool.toml file path, if not within the + current working directory + -v Increase verbosity, up to three times + --version Show version information + -h,--help Show this help text \ No newline at end of file diff --git a/docs/datatypetool_toml.md b/docs/datatypetool_toml.md index e864581..1ef3abd 100644 --- a/docs/datatypetool_toml.md +++ b/docs/datatypetool_toml.md @@ -19,19 +19,5 @@ Here's a listing of the settings to configure: - The version of the language to target. Aims to assist in language deprecations and additions. - Language-Specific Settings: - - Python - - Javascript - - Haskell - - Elm - - Gleam - - JsonSchema - - PKL - - Java - - C - - C++ - - C# - - Ruby - - Rust - - Purescript - - Zig + - TODO diff --git a/docs/developing.md b/docs/developing.md index f92861a..15c356f 100644 --- a/docs/developing.md +++ b/docs/developing.md @@ -2,7 +2,7 @@ Hopefully everything necessary is in the nix-shell. If not, feel free to modify Common things are kept in the `justfile`, for ease of execution. Just is in the nix-shell, if you don't have it and have nix. -Formatting of Haskell should be done with stylish-haskell, which is in the nix-shell if you don't have it. +Formatting of Haskell should be done with stylish-haskell, which is in the nix-shell if you don't have it. This is the command I used: `stylish-haskell --inplace -r app/*.hs` Formatting of the cabal file can be done with cabal-fmt, which is also in the nix-shell. This is the command I used: `cabal-fmt --inplace --indent 2 ./datatypetool.cabal` diff --git a/justfile b/justfile index 0eb932c..848187b 100644 --- a/justfile +++ b/justfile @@ -8,7 +8,7 @@ # Format all the things @format: - stylish-haskell --inplace app/*.hs + stylish-haskell --inplace -r app/*.hs cabal-fmt --inplace --indent 2 ./datatypetool.cabal nixfmt shell.nix nix/*