Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Richard Tong
    @richytong
    console.log('hello world')
    Alisson Cavalcante Agiani
    @thelinuxlich
    hey Richard
    how do we handle short-circuiting in Rubico? I don't see examples handling ADTs
    Richard Tong
    @richytong

    Hello Alisson, thanks for being the first to chat. Short circuiting was available prior to v1 with the functions amp (for &&) and alt (for ||), but these were since left out because I was worried their names were too idiosyncratic. In the earlier days, I remember favoring predicate composition (started out as ternary) to short circuiting, which led to the function switchCase which is part of the core API now.

    That said, short circuiting is currently not possible with rubico, but I think there's definitely room for it, at least in rubico/x. I believe there should be a discussion around what function names should be used, especially in the context of ADTs because the function names should mirror the method calls of an ADT that has short circuiting available. Maybe we could start looking at some example ADTs in this regard when thinking about the function names.

    Richard Tong
    @richytong
    also I may have misinterpreted what you meant by short circuiting - there's short circuiting in the sense of boolean logic and also short circuiting a fold operation. fantasy-land is talking about shortFoldl and shortFoldr for example in fantasyland/fantasy-land#224. I personally like reduce.while for short circuiting a fold operation, maybe reduce.rightWhilefor the right version. These names don't really respect the adt conventions though - I'm not sure anything is standardized right now.
    Alisson Cavalcante Agiani
    @thelinuxlich
    Do you know Sanctuary?
    Alisson Cavalcante Agiani
    @thelinuxlich
    I would like to help you with this project, but the structure seems a bit messy