Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Jan 30 2019 10:17
  • Jan 22 2019 13:29
    cdoublev commented #215
  • Jan 21 2019 23:57

    robotlolita on v4.x

    (compare)

  • Jan 21 2019 23:56

    robotlolita on 2.1.0

    (compare)

  • Jan 21 2019 23:56

    robotlolita on deferred-message

    (compare)

  • Jan 21 2019 23:56

    robotlolita on union-constructors

    (compare)

  • Jan 21 2019 23:55
    robotlolita closed #186
  • Jan 21 2019 23:55
    robotlolita closed #185
  • Jan 21 2019 23:55
    robotlolita closed #184
  • Jan 21 2019 23:55
    robotlolita closed #183
  • Jan 21 2019 23:55
    robotlolita closed #182
  • Jan 21 2019 23:55
    robotlolita closed #181
  • Jan 21 2019 23:55

    robotlolita on typescript

    (compare)

  • Jan 21 2019 23:54

    robotlolita on gh-pages

    (compare)

  • Jan 21 2019 23:54

    robotlolita on logo

    (compare)

  • Jan 21 2019 23:25
    robotlolita commented #215
  • Jan 21 2019 23:24
    robotlolita labeled #215
  • Jan 21 2019 23:19

    robotlolita on v2.3.2

    (compare)

  • Jan 21 2019 23:16

    robotlolita on master

    Updates changelog, version to 2… More stylistic fixes (compare)

  • Jan 21 2019 15:42
Riccardo Agnoletto
@Trebh

Hello good people, I'm trying the tstypes version of folktale, and was wandering if/how can I import the Task type definition so that I can use it as a return type for some functions of mine.

Things like this:

import {concurrency} from 'folktale';

and then trying to use concurrency.task as a typescript type seem to fail... I feel like I'm missing something obvious

Quil
@robotlolita
@Trebh "tstypes version of folktale"? Right now there isn't any official release of Folktale supporting TypeScript. If you're using a separate package's typings I guess you'd have to look at how they decided to implement it.
(There's work in progress for moving folktale to typescript, but I haven't been able to work on it for the last year as I was relocating to Sweden. Still dealing with relocation stuff actually)
Galileo Sanchez
@galileopy
@robotlolita for some reason I've been unable to find your guide to writing js apps. do you mind sending me a link?
@robotlolita found it, it was not listed in the blog, got to it through google.
Quil
@robotlolita
Mmh, I don't remember making a guide to writing js apps tbh :')
Galileo Sanchez
@galileopy
Leo Duran
@leoduran_gitlab
Greetings
Maxim
@sankemax
Hello all, I've just found this library and I was wondering - is it production ready? Is it still maintained?
pentatronix
@pentatronix
I believe that both are true, however gitter isn't exactly hopping any more.
Quil
@robotlolita
@sankemax version 1 is deprecated, and version 2 should be production-ready (with the exception of APIs marked as "experimental", which don't have a particularly solid foundation and haven't been as well-tested as I wish they had been). It's maintained in the sense that I'll still fix bugs if people report them on GitHub (i generally don't get notifications for gitter stuff), but since moving to another country has been a lot more work than predicted I haven't had time to work on any new stuff yet (which means the new version with TypeScript support is still going to take a while to be released)
(That's not to say that you can't use experimental APIs in production, just be aware that you might end up hitting some edge cases that I hadn't thought of, and it might be not as straightforward to debug. Tasks are a good example of this origamitower/folktale#178)
Daniel Sokil
@s0kil
Is folktale a project the author continues to maintain and improve?
Galileo Sanchez
@galileopy

@s0kil that would be @robotlolita

Is folktale a project the author continues to maintain and improve?

@s0kil you can refer to this

@sankemax version 1 is deprecated, and version 2 should be production-ready (with the exception of APIs marked as "experimental", which don't have a particularly solid foundation and haven't been as well-tested as I wish they had been). It's maintained in the sense that I'll still fix bugs if people report them on GitHub (i generally don't get notifications for gitter stuff), but since moving to another country has been a lot more work than predicted I haven't had time to work on any new stuff yet (which means the new version with TypeScript support is still going to take a while to be released)

Skandrovic
@Skandrovic
I've been introduced recently to functionnal programming and was looking for a library to work with, then I've found folkaleJS and that's the best docs that I've ever read. Folktale is simple and doesn't change a lot my programming style compared to other libraries. But unfortunatally, the union module that I wanted to use for safe error handling is still exprimental. Based on these discussions. I don't think that there will be other updates.
Do you know what are some other good libraries similar to Folktale and stable or that implement only the union types that I can combine with folktale ? thanks
Nik
@niksosf
@Skandrovic so for sum types, I like union-type by paldepind or daggy
Keith Alexander
@kwijibo
Hi, I started using the "new" origamitower folktale task and it's great, but I'm wondering how to adapt a pattern I have been using with the old-style Task.
For rejections, I would use daggy to enumerate different kinds of failures with a sum type, and then handle them in the rejection handler of the .fork(reject, success) call
but in the new API, they need to all be Errors thrown to .catch() right?
I suppose I can still do my pattern, and use .orElse(rejectionsHandler).run().promise().catch(handleUnforseenErrors)
Keith Alexander
@kwijibo
I keep getting this error using the new Task, and I can't figure out why " Error: Only pending deferreds can be rejected, this deferred is already resolved"
Alex Borodin
@borodinalive
Hi, everyone! Maybe has a FILTER method. But it's not documented. It works fine, but what should I use instead if it has 'experimental' state (like in RESULT)?
Michal Sevcik
@MelkorNemesis
Hey guys, is there a different way other than matchWith how to tell if Validation failed or not? I would like to use something like isFailure or isSuccess properties, but that is a no-go in a folktale afaik
Michal Sevcik
@MelkorNemesis
just found out a hasInstance method could be a way
Michal Sevcik
@MelkorNemesis
are there Any, All semigroups in folktale or do I have to create my own?
KAMi KZ
@kamikz85_twitter
@MelkorNemesis Not that I am aware of. You might have to use Crocks or urbandrone/futils for those semigroups. Or write you own with DrBoolean's instructions.
KAMi KZ
@kamikz85_twitter

@borodinalive maybe use a kind of a thin broker like

// _unstableFilterMaybe.js
export default  pred => m => m.filter(pred)

// your code
import _filterMaybe from '_unstableFilterMaybe.js'
_filterMaybe( x => !!x)(someMaybe)

At least this way, even if you used the experimental filter and if one day it changed implementation, you only have one file, namely _unstableFilterMaybe.js, to change to accommodate your own code.

Michal Sevcik
@MelkorNemesis
@kamikz85_twitter Thanks, I thought it was the case.
James Ramm
@JamesRamm

Hi, new(ish) user of Folktale, its great thanks!
I have a, probably basic, problem which I cannot figure out. I have two Task objects, each of which will resolve to an array, e.g.:

const t1 = Task.of([49]);
const t2 = Task.of(['john', 'paul']); // In reality, these tasks are being created from promises which are fetching data

I want to merge the arrays such that I get each unique combination, e.g. if I had just arrays I might do:

a1.map(resourceId => a2.map(name => ({ name, resourceId }))) // [{ name: 'john', resourceId : 49}, { name: 'paul', resourceId: 49}]

I can't figure out the best way to do this from Tasks - any help appreciated!

KAMi KZ
@kamikz85_twitter

@JamesRamm Hi James, I think you can do that through something called list comprehension. So I am using a library that does List monoid immutable-ext to achieve the result:

import { task, of, waitAll }  from 'folktale/concurrency/task';
import { List } from 'immutable-ext';

const ids         = of([49, 51])
const names       = of(['joh', 'paul', 'francis'])
const comprehend  =  id => name => ({id, name})
let res = {};

waitAll([ids, names])
  .run()
  .listen({onResolved: ([ids, names]) => 
    {
      res = {value: List.of(comprehend).ap(List(ids)).ap(List(names)).toArray()}

    }
  })

Here's the link to the code sandbox https://codesandbox.io/s/competent-river-mqx2u?file=/src/App.tsx

the above should yield
{
  "value": [
    {
      "id": 49,
      "name": "joh"
    },
    {
      "id": 49,
      "name": "paul"
    },
    {
      "id": 49,
      "name": "francis"
    },
    {
      "id": 51,
      "name": "joh"
    },
    {
      "id": 51,
      "name": "paul"
    },
    {
      "id": 51,
      "name": "francis"
    }
  ]
}