From ddccf8ff591d0f42ba3451976d5f8f64d0f1052e Mon Sep 17 00:00:00 2001 From: Luke Boswell Date: Sun, 5 May 2024 16:46:34 +0200 Subject: [PATCH] update glue platform files to new syntax --- crates/glue/platform/File.roc | 4 +--- crates/glue/platform/Shape.roc | 6 +++--- crates/glue/platform/Target.roc | 4 +--- crates/glue/platform/TypeId.roc | 4 +--- crates/glue/platform/Types.roc | 11 +++++++---- 5 files changed, 13 insertions(+), 16 deletions(-) diff --git a/crates/glue/platform/File.roc b/crates/glue/platform/File.roc index da7a99e517..6816113353 100644 --- a/crates/glue/platform/File.roc +++ b/crates/glue/platform/File.roc @@ -1,5 +1,3 @@ -interface File - exposes [File] - imports [] +module [File] File : { name : Str, content : Str } diff --git a/crates/glue/platform/Shape.roc b/crates/glue/platform/Shape.roc index 14d805fed4..56ffad8d40 100644 --- a/crates/glue/platform/Shape.roc +++ b/crates/glue/platform/Shape.roc @@ -1,6 +1,6 @@ -interface Shape - exposes [Shape, RocNum, RocTagUnion, RocStructFields, RocFn, RocSingleTagPayload] - imports [TypeId.{ TypeId }] +module [Shape, RocNum, RocTagUnion, RocStructFields, RocFn, RocSingleTagPayload] + +import TypeId exposing [TypeId] Shape : [ RocStr, diff --git a/crates/glue/platform/Target.roc b/crates/glue/platform/Target.roc index b4a0588efa..92f18cfa8e 100644 --- a/crates/glue/platform/Target.roc +++ b/crates/glue/platform/Target.roc @@ -1,6 +1,4 @@ -interface Target - exposes [Target, Architecture, OperatingSystem] - imports [] +module [Target, Architecture, OperatingSystem] Target : { architecture : Architecture, diff --git a/crates/glue/platform/TypeId.roc b/crates/glue/platform/TypeId.roc index 21b5c26bfc..dac002a1dc 100644 --- a/crates/glue/platform/TypeId.roc +++ b/crates/glue/platform/TypeId.roc @@ -1,6 +1,4 @@ -interface TypeId - exposes [TypeId, typeIDfromU64, typeIDtoU64] - imports [] +module [TypeId, typeIDfromU64, typeIDtoU64] TypeId := U64 implements [Eq, Hash, Inspect, Encoding] diff --git a/crates/glue/platform/Types.roc b/crates/glue/platform/Types.roc index 3389e8cfcc..ff50eb6938 100644 --- a/crates/glue/platform/Types.roc +++ b/crates/glue/platform/Types.roc @@ -1,6 +1,8 @@ -interface Types - exposes [Types, shape, size, alignment, target, walkShapes, entryPoints] - imports [Shape.{ Shape }, TypeId.{ TypeId, typeIDfromU64, typeIDtoU64 }, Target.{ Target }] +module [Types, shape, size, alignment, target, walkShapes, entryPoints] + +import Shape exposing [Shape] +import TypeId exposing [TypeId, typeIDfromU64, typeIDtoU64] +import Target exposing [Target] # TODO: switch AssocList uses to Dict once roc_std is updated. Tuple1 : [T Str TypeId] @@ -23,7 +25,8 @@ Types := { ## Names and types of the entry points of the program (e.g. mainForHost) entrypoints : List Tuple1, target : Target, -} implements [Inspect, Encoding] +} + implements [Inspect, Encoding] target : Types -> Target target = \@Types types -> types.target