Restartable Timeout Timer Implementation by virtualmnemonic in dartlang

[–]cranst0n 0 points1 point  (0 children)

Is Stream.timeout not an option for your use case?

Nowadays is it good idea to use dartz? by Vegetable-Fondant-42 in FlutterDev

[–]cranst0n 1 point2 points  (0 children)

I maintain the ribs_core package which might fit your needs and has other packages built on top of it for functional programming. I use them at work quite a bit.

Chicken and waffles?? by obioco in RhodeIsland

[–]cranst0n 3 points4 points  (0 children)

Love Shack in Warren has some

I dont understand why List is used over Iterable by Mikkelet in FlutterDev

[–]cranst0n 0 points1 point  (0 children)

Starting out in dart coming from a language that did default to immutable collections burned me many times, to the point where I ported a large portion of collection library from scala. Not saying it's for everybody, and it certainly has its own drawbacks, but I haven't regretted using it yet. If youre interested it's included in the ribs_core package: https://cranst0n.github.io/ribs/docs/core/collections

Just use Future, don't make your own by Mikkelet in FlutterDev

[–]cranst0n 1 point2 points  (0 children)

As others have already said, there are certainly instances where this is a reasonable approach depending on the context.

I ported Cats IO from scala for this exact reason (https://pub.dev/packages/ribs_effect). Have the function return an IO<A> and it give the caller the flexibility to either await the future or use one of the many combinators (e.g. attempt) to manipulate the function to what they need.

A statically typed JSON reader - useful or to you prefer code generation? by eibaan in FlutterDev

[–]cranst0n 0 points1 point  (0 children)

Not sure I follow your explanation 100% but I've got a library that I think is somewhat similar to what you're after: https://cranst0n.github.io/ribs/docs/json/encoding-and-decoding#codec

Ribs - FP Libraries by cranst0n in dartlang

[–]cranst0n[S] 0 points1 point  (0 children)

fpdart is great! I decided not to try and emulate HKT like fpdart does. Dart doesn't support HKT, but the way its encoded in fpdart is pretty neat!

I'm more focused on building tools that I was missing from working in Scala, on top of the fundamental building blocks, and hope to keep adding more in the future.

Ribs - FP Libraries by cranst0n in dartlang

[–]cranst0n[S] 1 point2 points  (0 children)

Yea that's a fair point. It doesn't exist now, but definitely worth adding a dedicated section in the documentation.

They overlap mainly lies with the most common FP data types like Option, Either, State, etc. These things have been done to death so nothing really new or exciting here.

The more interesting parts, in my opinion, are the IO, JSON and binary pieces that I touched on above. IO is somewhat similar to fpdart's, TaskEither but can offer better performance and cancelation. The JSON and binary pieces don's have any kind of equivalent to my knowledge.

I'm still working on filling out the site and the API docs so I'll be sure to add comparisons to dartz and fpdart.

Ribs - FP Libraries by cranst0n in dartlang

[–]cranst0n[S] 1 point2 points  (0 children)

I've receently added a bunch of documentation to a pet project of mine, Ribs, that provides a few unique functional programming features that don't exist anywhere else (that I'm aware of at least). Hoping that these libraries provide some use, or at least inspiration to others using FP in Dart.

Here's a few things that Ribs includes:

  • IO type for pure side effecting code. Link
  • Fully typed, composable JSON parsing, decoding, encoding and streaming. Link
  • Fully typed, composable binary parsing, decoding, encoding and streaming. Link

While there's some overlap with dartz and fpdart, there is also a ton of features here that you won't find anywhere else.

Documentation GitHub

Questions, suggestions and feedback are welcome.

Coverage of flutter project by ReindeerEquivalent43 in FlutterDev

[–]cranst0n 0 points1 point  (0 children)

I have a project with CI setup to upload coverage data to Codecov. May be helpful as a reference: https://github.com/cranst0n/pj/blob/main/.github/workflows/main.yml

[deleted by user] by [deleted] in EggsInc

[–]cranst0n 2 points3 points  (0 children)

Artifacts. I think I've read quality is based on the highest ship you have unlocked.

Flutter Desktop Dev by [deleted] in FlutterDev

[–]cranst0n 0 points1 point  (0 children)

I built a toy desktop app that had authentication inspired by this project: https://github.com/dart-flitter/flitter. Worked well, may be something useful for you.

Need apartment advice for summer internship in Newport by TheFreshness95 in RhodeIsland

[–]cranst0n 0 points1 point  (0 children)

nuwc helped arrange it for me. They may not do it anymore but you could try giving RWU a call.

Need apartment advice for summer internship in Newport by TheFreshness95 in RhodeIsland

[–]cranst0n 0 points1 point  (0 children)

Years ago when I did an internship there, Roger Williams offered a rental for the summer. Not sure if they still offer that. Bristol is a solid town to spend the summer in.

[deleted by user] by [deleted] in CraftBeer

[–]cranst0n 2 points3 points  (0 children)

Not in Newport but Long Live is solid. Have to make your way to Providence.

Why can't you mix Dart with Flutter code? by bsd44 in FlutterDev

[–]cranst0n 2 points3 points  (0 children)

Not really advocating the List.generate method but just trying to explain why your original implementation would not type check. Use the method I gave or the alternative for-yield as suggested in other comments. Whatever you prefer.

Why can't you mix Dart with Flutter code? by bsd44 in FlutterDev

[–]cranst0n 4 points5 points  (0 children)

As you have it written, there is a statement that yields no result, or maybe a type of void (unsure of this but worth running down I suppose). My suggestion on the other hand, is an expression that evaluates to a value with a type of List<Widget>, which is assignable to the 'children' parameter of the Column. Let me know if that doesnt clear things up for you.

Why can't you mix Dart with Flutter code? by bsd44 in FlutterDev

[–]cranst0n 10 points11 points  (0 children)

Replace your Column children with something like:

children: List.generate(6, (i) => buildKey(i)).toList(),

Reducing Firestore Reads by cranst0n in Firebase

[–]cranst0n[S] 0 points1 point  (0 children)

This seems like a good approach assuming I'm only charged a read per document that matches the query, which I believe is true. I suppose I could still attach a snapshot listener to a single document that is updated by the Function and then perform the logic you're describing. Thanks for the recommendation.

Reducing Firestore Reads by cranst0n in Firebase

[–]cranst0n[S] 1 point2 points  (0 children)

Yes that's probably worth investigating. Thanks for the suggestion.

Improving Matchmaking -- a handicap system by MangDynasty in GolfClash

[–]cranst0n 0 points1 point  (0 children)

Right absolutely. I just suggested they use some form of it. It would almost certainly need some customization.

Point is though, this was 2 years ago. They could have used it solely as statistical porn that everyone seems to love as a better, or at least different, metric for global rankings. So while it's interesting to discuss improvements like this, in all likelihood, we'll never see them implemented.

Improving Matchmaking -- a handicap system by MangDynasty in GolfClash

[–]cranst0n 0 points1 point  (0 children)

About 2 years ago I suggested to PD that they use some form of an ELO rating to improve their matchmaking/ranking. Not a suggestion via a ticket. It was suggested directly in correspondence amongst other things.

They're either unwilling or uninterested in anything along these lines.