asc-community / asc-community/AngouriMath

[WIP] Complete redesign of AngouriMath.FSharp

Open
#575 3 comments 0 reactions 0 assignees View on GitHub
Area: F# Design document Opinions wanted
Dominant language
C#
Stars
831
Forks
79
Avg merge
3h 23m
Merged PRs (30d)
309

Description

## Current problem

1. First of all, naming is weird. E. g. `simplified` and `compiled` feel weird (not to mention `derivative` vs `derivativeNode`)
2. Second, too long naming. `derivative` seems imo too long for something so commonly used. I think we can make it short.3.
3. There are also some poorly named functions, like `asNumber`. What does it do? Well, it *evaluates* to a number.
4. Weird undocumented operators, like [this one](https://github.com/asc-community/AngouriMath/blob/ec80234dfbdf2d045c427651701394139d67f6a1/Sources/Wrappers/AngouriMath.FSharp/Operators.fs#L9)
5. [Shortcuts](https://github.com/asc-community/AngouriMath/blob/master/Sources/Wrappers/AngouriMath.FSharp/Shortcuts.fs#L14) which are too simple to take space in the library, and aren't very convenient to remember without IDE support

## Suggested API

It should be concise, clear, consistent.

### AngouriMath.FSharp.Functions

```fs
val simplify : obj -> Entity
val eval : obj -> Entity
val sub : (var : obj) -> (value : obj) -> (expr : obj) -> obj

val toInt32 : obj -> int
val toInt64 : obj -> long
val toFloat32 : obj -> float
val toFloat64 : obj -> double
val toBool : obj -> bool

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.