diff options
| author | Marcos Magueta <maguetamarcos@gmail.com> | 2026-04-03 16:17:38 -0300 |
|---|---|---|
| committer | Marcos Magueta <maguetamarcos@gmail.com> | 2026-04-03 16:17:38 -0300 |
| commit | 63ae3c930de89af6f85229a467caa3f53cb844a2 (patch) | |
| tree | cda4d513672f9fefa09c3a1dff69d8443890e224 /lib/schema.ml | |
| parent | c5bc3a4992b4968780c286a084ad7c02b2b58f1e (diff) | |
| download | Sakura-63ae3c930de89af6f85229a467caa3f53cb844a2.tar.gz Sakura-63ae3c930de89af6f85229a467caa3f53cb844a2.zip | |
format
Diffstat (limited to 'lib/schema.ml')
| -rw-r--r-- | lib/schema.ml | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/lib/schema.ml b/lib/schema.ml index e17f7a5..923284a 100644 --- a/lib/schema.ml +++ b/lib/schema.ml @@ -1,7 +1,7 @@ (** Schema: maps attribute names to domain/type names. - A schema defines the structure of a relation by listing each attribute - and its associated domain (type). This is used for: + A schema defines the structure of a relation by listing each attribute and + its associated domain (type). This is used for: - Hashing relations (schema is part of the relation identity) - Validation (checking tuple membership) - Persistence (storing and loading relations with their structure) *) @@ -9,13 +9,8 @@ type t = (string * string) list let empty : t = [] - -let add name domain_name (schema : t) : t = - (name, domain_name) :: schema - -let attributes (schema : t) = - List.map fst schema +let add name domain_name (schema : t) : t = (name, domain_name) :: schema +let attributes (schema : t) = List.map fst schema let to_string schema = - List.map (fun (n, t) -> n ^ ":" ^ t) schema - |> String.concat "," + List.map (fun (n, t) -> n ^ ":" ^ t) schema |> String.concat "," |
