Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Piotr Zolnierek
    @pzol
    Dumdudun

    titke

    tpaktop
    @Maxim-Filimonov
    @pzol any plans to release a new version?
    Piotr Zolnierek
    @pzol
    @Maxim-Filimonov release v0.15.3
    Jacques Fuentes
    @jpfuentes2
    any interest in adding Result#fold as a catamorphism?
    right now it looks like expected flow for checking Result success/failure is with match or with conditionals
    class Deterministic::Result
      def fold(failure, success)
        match {
          Success(_) { |s| success.call(s.value) }
          Failure(_) { |f| failure.call(f.value) }
        }
      end
    end
    example usage:
    def render_result(status, result)
      result.fold(
        ->(f) { render_failures(500, f) },
        ->(v) { render_json(status, v) }
      )
    end
    Piotr Zolnierek
    @pzol
    good idea, want to submit a PR .did you look into the example linked list? it contains a #fold method
    Michał Muskała
    @michalmuskala
    Hey, any idea why blocks in matches are running in some wired context?
    Andy Arminio
    @5thWall
    Anyone have any idea why values aren't being unwrapped in matchers?
    Joe Gaudet
    @joegaudet
    Stoked to find this .
    Would be neat to get a Future / Promise monad in there
    Piotr Zolnierek
    @pzol
    @joegaudet hey, that would probably worth a separate gem, but you could use the building blocks