bloodyowl Github contribution chart
bloodyowl Github Stats
bloodyowl Most Used Languages

Activity

20 Sep 2022

Bloodyowl

fix: tap function should't have return value

Created On 20 Sep 2022 at 12:27:14
Issue Comment

Bloodyowl

fix: tap function should't have return value

The void type is notably used to describe the return value of functions that do not return anything. The unknown type is similar to any, in that it also represents a type that is apriori not known

rxjs tap:

tap<T>(next: (value: T) => void): 

Forked On 20 Sep 2022 at 12:27:13

Bloodyowl

the unknown type is intentional here, so that you can pass a function that returns anything without having to wrap it in a lambda function, e.g:

value
  .map(x => x * 2)
  .tap(logAndReturnSomething)
  .flatMap(doSomething) 

Commented On 20 Sep 2022 at 12:27:13

Bloodyowl

docs: toResult desc

Pushed On 20 Sep 2022 at 12:25:39

Bloodyowl

Merge pull request #36 from ahaoboy/main

docs: toResult desc

Pushed On 20 Sep 2022 at 12:25:39

Bloodyowl

docs: toResult desc

Created On 20 Sep 2022 at 12:25:38
Issue Comment

Bloodyowl

docs: toResult desc
Forked On 20 Sep 2022 at 12:25:35

Bloodyowl

thank you!

Commented On 20 Sep 2022 at 12:25:35
Issue Comment

Bloodyowl

Would it be weird to have a new constructor method on Option to create an option from truthy?

Don't know if this is something smart, but would it be interesting to have an API like this:

Option.fromTruthy('') // Option<string> // effectively would be a None
Option.fromTruthy(0) // Option<number> // effectively would be a None
Option.fromTruthy(-0) // Option<number> // effectively would be a None
Option.fromTruthy(undefined) // Option<undefined> // effectively would be a None
Option.fromTruthy(null) // Option<null> // effectively would be a None
Option.fromTruthy(NaN) // Option<number> // effectively would be a None 

If theres interest I can make a PR and test it as well

Forked On 20 Sep 2022 at 12:21:53

Bloodyowl

I'd prefer to avoid that kind of implicit behavior, Option will for the foreseeable future only expose fromNullable, fromUndefined & fromNull

Commented On 20 Sep 2022 at 12:21:53
Issue Comment

Bloodyowl

How do you deal if you want to handle results and async functions?

is there such a thing as an async map? something that would, instead of returning Result<Promise<true>> to Promise<Result<true>>?

So that it would be obvious?

I do not know, if it is possible but would be great!

thanks,

Forked On 20 Sep 2022 at 12:20:25

Bloodyowl

you can use:

Future.value(getUser())
  .flatMapOk(user => Future.fromPromise(getInfo(user))) 

which gives you a Future<UserInfo, Error>.

you can await it or convert back to a promise using .toPromise() 😊

Commented On 20 Sep 2022 at 12:20:25

Bloodyowl

Search params support for areas
Merged On 19 Sep 2022 at 10:32:21

Bloodyowl

Commented On 19 Sep 2022 at 10:32:21
Issue Comment

Bloodyowl

How do you deal if you want to handle results and async functions?

is there such a thing as an async map? something that would, instead of returning Result<Promise<true>> to Promise<Result<true>>?

So that it would be obvious?

I do not know, if it is possible but would be great!

thanks,

Forked On 15 Sep 2022 at 09:18:59

Bloodyowl

could you elaborate on this? not sure I'm getting your question

Commented On 15 Sep 2022 at 09:18:59
Issue Comment

Bloodyowl

Fixed DataView.

DataView

  • All the accessor functions in DataView were completely broken. This is fixed.
  • For set functions where inputs could be truncated or rounded implicitly, I've created two bindings, a set*Truncated/set*Rounded binding, and a set* binding. The second binding only accepts values that cannot be implicitly modified.
  • If a set function has two bindings, so does its corresponding get function: get*Raw and get*. The second binding returns a constrained value.
  • Added a doc file explaining my design decisions and how to use DataView
  • These changes are backwards incompatible with any code that called get* or set*.

BigInt

  • Added gt, ge, lt, le functions

Testing

  • All functions added/modified have tests
  • Added a github test workflow.

Other

  • package.json scripts are now sorted alphabetically
  • Upgraded to latest version of ReScript.

Forked On 14 Sep 2022 at 03:28:17

Bloodyowl

hi! thanks for your PR.

I have a few questions & notes, as this PR doesn't fit rescript-js's approach.

All the accessor functions in DataView were completely broken

what do you mean?

  • For set functions where inputs could be truncated or rounded implicitly, I've created two bindings, a setTruncated/setRounded binding, and a set* binding. The second binding only accepts values that cannot be implicitly modified.
  • If a set function has two bindings, so does its corresponding get function: getRaw and get. The second binding returns a constrained value.

I'm not willing to switch to the ConstrainedTypes API here, this library is general-purpose and aims to be zero-cost.

For the littleEndian param, I think I'd be a better API to expose getXWithLittleEndian to avoid having currying issues.

Commented On 14 Sep 2022 at 03:28:17

Bloodyowl

fix(content): interverted content

Pushed On 27 Aug 2022 at 02:54:28

Bloodyowl

Merge pull request #253 from MathRobin/master

fix(content): interverted content

Pushed On 27 Aug 2022 at 02:54:28

Bloodyowl

fix(content): interverted content

Created On 27 Aug 2022 at 02:54:27
Issue Comment

Bloodyowl

fix(content): interverted content
Forked On 27 Aug 2022 at 02:54:24

Bloodyowl

thank you!

Commented On 27 Aug 2022 at 02:54:24
Create Branch
Bloodyowl In bloodyowl/rescript-js Create Branchv1.0.0-beta.2

Bloodyowl

Bindings to the JS standard library

On 18 Aug 2022 at 12:09:58

Bloodyowl

1.0.0-beta.2 release notes

Pushed On 18 Aug 2022 at 12:09:57

Bloodyowl

v1.0.0-beta.2

Pushed On 18 Aug 2022 at 12:09:57

Bloodyowl

Fix nullable return type of Js.RegExp.exec

Pushed On 18 Aug 2022 at 12:05:09

Bloodyowl

Merge pull request #24 from Minnozz/fix-regexp-exec

Fix nullable return type of Js.RegExp.exec

Pushed On 18 Aug 2022 at 12:05:09

Bloodyowl

Fix nullable return type of Js.RegExp.exec

Created On 18 Aug 2022 at 12:05:09
Issue Comment

Bloodyowl

Fix nullable return type of Js.RegExp.exec

Fixes #21

Forked On 18 Aug 2022 at 12:05:05

Bloodyowl

Nice catch! Thank you!

Commented On 18 Aug 2022 at 12:05:05

Bloodyowl

Made DataView public

Pushed On 18 Aug 2022 at 12:04:45

Bloodyowl

Merge pull request #18 from LoganGrier/FIX/DataView

Made DataView public

Pushed On 18 Aug 2022 at 12:04:45

Bloodyowl

Made DataView public

Created On 18 Aug 2022 at 12:04:44
Issue Comment

Bloodyowl

Made DataView public
Forked On 18 Aug 2022 at 12:04:40

Bloodyowl

Thank you!

Commented On 18 Aug 2022 at 12:04:40
Issue Comment

Bloodyowl

Fix 'caml_as_js_exn is not a function'

Fixes #22

Forked On 18 Aug 2022 at 12:03:24

Bloodyowl

Thank you!

Commented On 18 Aug 2022 at 12:03:24

Bloodyowl

fix 'caml_as_js_exn is not a function'

Pushed On 18 Aug 2022 at 12:03:20

Bloodyowl

Merge pull request #23 from jeddeloh/main

Fix 'caml_as_js_exn is not a function'

Pushed On 18 Aug 2022 at 12:03:20

Bloodyowl

Fix 'caml_as_js_exn is not a function'

Created On 18 Aug 2022 at 12:03:20

Bloodyowl

Improve tests + route concat

Add type-level tests for types.ts file + improve route concat logic + update Docusaurus to v2 stable

Merged On 10 Aug 2022 at 08:58:13

Bloodyowl

Commented On 10 Aug 2022 at 08:58:13
Create Branch
Bloodyowl In swan-io/boxed Create Branchv0.11.1

Bloodyowl

Utility types for functional TypeScript

On 05 Aug 2022 at 10:01:50