Fix List.range type annotation bug

This commit is contained in:
Richard Feldman 2022-12-09 06:53:10 -05:00
parent 234f9f54cd
commit 7d8b9b2323
No known key found for this signature in database
GPG key ID: F1F21AA5B1D9E43B

View file

@ -657,15 +657,7 @@ mapWithIndexHelp = \src, dest, func, index, length ->
##
## All of these options are compatible with the others. For example, you can use `At` or `After`
## with `start` regardless of what `end` and `step` are set to.
# TODO: Make the type annotation work
# range :
# {
# start : [At (Int a), After (Int a)],
# end : [At (Int a), Before (Int a), Length Nat],
# # TODO: We want this to be Int *, but that requires the ability to convert or add from Int * to Int a
# step ? Int a
# }
# -> List (Int a) | a has Bool.Eq
range : _
range = \{ start, end, step ? 0 } ->
{ incByStep, stepIsPositive } =
if step == 0 then