Skip to content

Commit 8c72af1

Browse files
committed
WIP
1 parent a90a3e6 commit 8c72af1

File tree

4 files changed

+22
-8
lines changed

4 files changed

+22
-8
lines changed

distribution/lib/Standard/Table/0.0.0-dev/src/Internal/Type_Refinements/Column_Refinements.enso

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import project.Column.Column
66
import project.Internal.Value_Type_Helpers
77
import project.Value_Type.Value_Type
88
from project.Internal.Type_Refinements.Single_Value_Column_Conversions import all
9+
from project.Internal.Type_Refinements.Typed_Column_Conversions import all
910

1011
refine_column (column : Column) =
1112
## We treat a column as single value if it contains a single not-nothing value.
@@ -18,18 +19,18 @@ refine_column (column : Column) =
1819
value = column.at 0
1920
case value of
2021
# If the value was really a float, we preserve that.
21-
_ : Float -> (column : Column & Float)
22+
_ : Float -> (column : Column & Numeric_Column & Float)
2223
# Otherwise we treat it as an integer.
23-
_ -> (column : Column & Integer)
24-
Value_Type.Float _ -> (column : Column & Float)
24+
_ -> (column : Column & Numeric_Column & Integer)
25+
Value_Type.Float _ -> (column : Column & Numeric_Column & Float)
2526
Value_Type.Char _ _ -> (column : Column & Text)
2627
Value_Type.Boolean -> (column : Column & Boolean)
2728
Value_Type.Date -> (column : Column & Date)
2829
Value_Type.Time -> (column : Column & Time_Of_Day)
2930
Value_Type.Date_Time True -> (column : Column & Date_Time)
3031
Value_Type.Decimal _ _ ->
3132
is_integer = Value_Type_Helpers.is_decimal_integer inferred_value_type
32-
if is_integer then (column : Column & Integer) else (column : Column & Decimal)
33+
if is_integer then (column : Column & Numeric_Column & Integer) else (column : Column & Numeric_Column & Decimal)
3334
# Other types (e.g. Mixed) are not supported.
3435
_ -> column
3536

distribution/lib/Standard/Table/0.0.0-dev/src/Internal/Type_Refinements/Table_Refinements.enso

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,18 @@ refine_table (table : Table) =
2222
value = column.at 0
2323
case value of
2424
# If the value was really a float, we preserve that.
25-
_ : Float -> (table : Table & Column & Float)
25+
_ : Float -> (table : Table & Column & Numeric_Column & Float)
2626
# Otherwise we treat it as an integer.
27-
_ -> (table : Table & Column & Integer)
28-
Value_Type.Float _ -> (table : Table & Column & Float)
27+
_ -> (table : Table & Column & Numeric_Column & Integer)
28+
Value_Type.Float _ -> (table : Table & Column & Numeric_Column & Float)
2929
Value_Type.Char _ _ -> (table : Table & Column & Text)
3030
Value_Type.Boolean -> (table : Table & Column & Boolean)
3131
Value_Type.Date -> (table : Table & Column & Date)
3232
Value_Type.Time -> (table : Table & Column & Time_Of_Day)
3333
Value_Type.Date_Time True -> (table : Table & Column & Date_Time)
3434
Value_Type.Decimal _ _ ->
3535
is_integer = Value_Type_Helpers.is_decimal_integer inferred_value_type
36-
if is_integer then (table : Table & Column & Integer) else (table : Table & Column & Decimal)
36+
if is_integer then (table : Table & Column & Numeric_Column & Integer) else (table : Table & Column & Numeric_Column & Decimal)
3737
# Other types (e.g. Mixed) are not supported.
3838
_ -> (table : Table & Column)
3939

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
private
2+
3+
## This conversion is internal and should never be exported.
4+
Numeric_Column.from (that : Column) =
5+
...
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
type Numeric_Column
2+
private Value column operations_implementation
3+
4+
abs self -> Numeric_Column =
5+
"TODO"
6+
7+
signum self -> Numeric_Column =
8+
"TODO"

0 commit comments

Comments
 (0)