Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upCore 2.0 - remove runtime exceptions #86
Conversation
laszlopandy
added some commits
Jan 9, 2015
laszlopandy
changed the title from
List no throw
to
Core 2.0 breaking changes
Jan 9, 2015
laszlopandy
changed the title from
Core 2.0 breaking changes
to
Core 2.0 - remove runtime exceptions
Jan 9, 2015
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
evancz
Jan 10, 2015
Member
Is it possible to do this in three batches? I think there are problems in the Graphics part, but not the others.
I believe some of the functions you hid are actually public. See this page for LineStyle, LineCap, LineStyle, and FillStyle.
|
Is it possible to do this in three batches? I think there are problems in the Graphics part, but not the others. I believe some of the functions you hid are actually public. See this page for LineStyle, LineCap, LineStyle, and FillStyle. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
evancz
Jan 10, 2015
Member
Also, don't bump the version number. I prefer to do it with elm-package bump right before a release. This way you always know your reference point when you are changing stuff.
|
Also, don't bump the version number. I prefer to do it with |
laszlopandy
closed this
Jan 10, 2015
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
deadfoxygrandpa
Jan 11, 2015
Contributor
Basics has a possible runtime exception:
function mod(a, b) {
if (b === 0) {
throw new Error("Cannot perform mod 0. Division by zero error.");
}
var r = a % b;
var m = a === 0 ? 0 : (b > 0 ? (a >= 0 ? r : r+b) : -mod(-a,-b));
return m === b ? 0 : m;
}Could this return NaN instead?
|
Basics has a possible runtime exception: function mod(a, b) {
if (b === 0) {
throw new Error("Cannot perform mod 0. Division by zero error.");
}
var r = a % b;
var m = a === 0 ? 0 : (b > 0 ? (a >= 0 ? r : r+b) : -mod(-a,-b));
return m === b ? 0 : m;
}Could this return NaN instead? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
evancz
Jan 11, 2015
Member
@deadfoxygrandpa, I don't really know what is the right thing here, but an error sort of feels more correct. I'd be interested if there is a better/faster implementation in general though.
|
@deadfoxygrandpa, I don't really know what is the right thing here, but an error sort of feels more correct. I'd be interested if there is a better/faster implementation in general though. |
laszlopandy commentedJan 9, 2015
Core 2.0:
List.head : List a -> Maybe aList.tailin favour ofList.drop 1List.foldl1,List.foldr1,List.scanl1List.unconsList.maximumandList.minimumto take default valuesGraphics.ModelDebugwill not includeCollageorElementBasicForm,LineCap,LineJoin,ShapeStyle,FillStyle,ElementPrim,ImageStyle,Three.Graphics.Modelrefactor.run-test.shwill now delete the elm-package version of core and symlink it to the local git version.