Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Mark Perry
    @mperry
    I made the various Github teams visible too
    Jean-Baptiste Giraudeau
    @jbgi
    @mperry Published! I think the problem was that I had to set my username/password in the publish.gradle file.
    Mark Perry
    @mperry
    Great. Add it the instructions do we don't have to remember this. I hope the instructions were not too unclear or vague.
    Jean-Baptiste Giraudeau
    @jbgi
    yeah, I will update the instructions with that. Also with how to make signing work with gpg2
    Normen Müller
    @normenmueller
    How to test equality for Validation<String,Path>? I have Validation<String,Path> x = toPath.f("/home\0") and Validation<String,Path> y = Validation.fail("Nul character not allowed: /home");. But x.equals(y) yields false although both are Fail(Nul character not allowed: /home).
    Jean-Baptiste Giraudeau
    @jbgi
    @normenmueller are you sure you are not comparing fail("Nul character not allowed: /home\0") and fail("Nul character not allowed: /home")? what is the implementation of f?
    Normen Müller
    @normenmueller
    jbgi you are right. everything fine now. thx
    Dimitar Georgiev
    @dimitarg
    hey folks, i was wondering if there is a name for this pattern and therefore more generic way to express it:
    Jean-Baptiste Giraudeau
    @jbgi
    Dimitar Georgiev
    @dimitarg
    do you have any pointers if I can utilise fj to implement a string prefix trie?
    my prefixes are not chars but arrays of char. So 'anexample' might become 'a'->'nex'->'amp'->'le', depending on a specific schema which determines the segments length (and all the input strings are fixed-length)
    I want to quickly answer questions such as , give me all input strings starting with 'a'->'nex'
    Dimitar Georgiev
    @dimitarg
    Hey folks, sorry for what is probably an extremely dumb question
    Why do P1 and F0 both exists? What is the difference?
    Dimitar Georgiev
    @dimitarg
    Can I think of P1 as an Embellished F0 which has map, bind, traverseXXX, etc ?
    Dimitar Georgiev
    @dimitarg
    I guess so, if I understood this correctly:
    Jean-Baptiste Giraudeau
    @jbgi
    P1 in an abstract class, and thus not eligible for instantiation via lambda syntax. I believe F0 was added only to get convenience of the lambda syntax. Ideally they're should have been only one. TODO for functionaljava 5.
    Although there is one big inconvenience of using interfaces: methods cannot be final which reduce the capacity to reason about code.
    Jean-Baptiste Giraudeau
    @jbgi
    this was not done in FJ 4 because default methods cannot be sanely retro-fitted for java 6 (using retrolambda). FJ 5 should be java8+ only so this open usage of default methods.
    Dimitar Georgiev
    @dimitarg
    Got it, thanks
    and so the stuff in F1W becomes the default methods on F1 and so forth
    Jean-Baptiste Giraudeau
    @jbgi
    yeah that would be the idea
    Dimitar Georgiev
    @dimitarg
    Would something like this warrant a pull request to fj, or is it too ad-hoc ?
    Jean-Baptiste Giraudeau
    @jbgi
    @dimitarg similar to bifunctorial IOthat John De Goes has been talking about for scalaz8?
    Dimitar Georgiev
    @dimitarg
    Nothing so accomplished, just convenience syntax (i.e. handwritten monad transformer) for P1<Validation<A>>, since that is what Try.f returns
    I saw no reason to constrain E to subclass exception in general
    public <E1> LazyEffect<E1, A> mapError(F<E, E1> f)  
    to be honest that one is a bit of an ad-hoc addition in case I needed it, I don't insist on it
    I hope I'm not doing anything funny in bind, I just followed the types
    Sometime this week it would also have a prop test that it has a monad
    Also maybe the underlying P1<Validation> can be exposed as public, and the isomorphism claim in the Javadoc can be dropped as I'm not sure whether that is correct formally, or helps
    Dimitar Georgiev
    @dimitarg
    @jbgi Yes, I do intend to use it as poor man's sync IO, and it would be redundant if we had IO in Java. But essentially it is just X<E,A> instead of P1<Validation<E,A>>, and just follows the types. Hopefully it is that.
    Jean-Baptiste Giraudeau
    @jbgi
    @/all thinking of releasing 4.8 this week-end (long overdue). Then we shall switch to jdk8+ only from now on.
    Tim
    @tirumalesh123
    Hello there
    Jean-Baptiste Giraudeau
    @jbgi
    Hi
    Mario Garrido Torres
    @MarioGT90
    Hello to all, I'm starting with functional programming with kotlin/Java
    mplain
    @mplain
    Hello there :)
    A very general question about java streams
    or rather, Optional
    if I have an Optional, and at a certain point i .map() its value to another Optional
    should I use .flatMap() here, to turn Optional<Optional<T>> into an Optional<T>
    or should i use .orElseThrow here instead, to better identify where in the chain the value got lost?
    or is throwing exceptions a bad practice and maybe i should use some monad instead?
    Drew Taylor
    @drewctaylor
    Will there be a 4.8.2 / 4.9 release for functionaljava?
    Mark Perry
    @mperry
    Released 4.9, see https://mvnrepository.com/artifact/org.functionaljava/functionaljava/4.9. I still need to get some doc together and put a message on the group. Working towards a FJ 5 release in the next few weeks.

    @jbgi, you posted on the group your ideas for FJ 5:
    Some items I'd like to tackle for next major release (5.0) :

    • fix deprecated usage so that FJ compile with Java 10.
    • remove deprecated methods and methods rendered obsolete by lambda syntax.
    • avoid any ambiguities arising from usage of method reference by moving static methods into companion class (eg. Lists for List).
    • remove unsafe APIs (unless necessary for stack safety).

    Can you expand on this, in particular point 3?