Merge pull request #4222 from roc-lang/explicit-imports-in-prelude

List dependencies in the stdlib explicitly rather than hard-coding
This commit is contained in:
Ayaz 2022-10-07 02:39:54 -05:00 committed by GitHub
commit f0786121fb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 69 additions and 17 deletions

View file

@ -30,6 +30,23 @@ interface Decode
]
imports [
List,
Result.{ Result },
Num.{
U8,
U16,
U32,
U64,
U128,
I8,
I16,
I32,
I64,
I128,
F32,
F64,
Dec,
},
Bool.{ Bool },
]
DecodeError : [TooShort]

View file

@ -20,6 +20,7 @@ interface Dict
Bool.{ Bool },
Result.{ Result },
List,
Num.{ Nat },
]
## A [dictionary](https://en.wikipedia.org/wiki/Associative_array) that lets you can associate keys with values.

View file

@ -27,7 +27,24 @@ interface Encode
append,
toBytes,
]
imports []
imports [
Num.{
U8,
U16,
U32,
U64,
U128,
I8,
I16,
I32,
I64,
I128,
F32,
F64,
Dec,
},
Bool.{ Bool },
]
Encoder fmt := List U8, fmt -> List U8 | fmt has EncoderFormatting

View file

@ -20,6 +20,7 @@ interface Hash
] imports [
List,
Str,
Num.{ U8, U16, U32, U64, U128, I8, I16, I32, I64, I128 },
]
## A value that can hashed.

View file

@ -18,6 +18,23 @@ interface Json
DecoderFormatting,
DecodeResult,
},
Num.{
U8,
U16,
U32,
U64,
U128,
I8,
I16,
I32,
I64,
I128,
F32,
F64,
Dec,
},
Bool.{ Bool },
Result,
]
Json := {} has [

View file

@ -63,6 +63,8 @@ interface List
]
imports [
Bool.{ Bool },
Result.{ Result },
Num.{ Nat, Num, Int },
]
## Types

View file

@ -145,6 +145,7 @@ interface Num
]
imports [
Bool.{ Bool },
Result.{ Result },
]
## Represents a number that could be either an [Int] or a [Frac].

View file

@ -14,7 +14,7 @@ interface Set
intersection,
difference,
]
imports [List, Bool.{ Bool }, Dict.{ Dict }]
imports [List, Bool.{ Bool }, Dict.{ Dict }, Num.{ Nat }]
Set k := Dict.Dict k {}

View file

@ -44,7 +44,12 @@ interface Str
walkScalars,
walkScalarsUntil,
]
imports [Bool.{ Bool }, Result.{ Result }, List]
imports [
Bool.{ Bool },
Result.{ Result },
List,
Num.{ Nat, Num, U8, U16, U32, U64, U128, I8, I16, I32, I64, I128, F32, F64, Dec },
]
## # Types
##