All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.tonivade.purefun.generic.HAppend Maven / Gradle / Ivy

/*
 * Copyright (c) 2018-2020, Antonio Gabriel Muñoz Conejo 
 * Distributed under the terms of the MIT License
 */
package com.github.tonivade.purefun.generic;

import com.github.tonivade.purefun.generic.HList.HCons;
import com.github.tonivade.purefun.generic.HList.HNil;

@FunctionalInterface
public interface HAppend, R extends HList, X extends HList> {

  X append(L left, R right);

  static > HAppend append() {
    return (empty, right) -> right;
  }

  static , R extends HList, X extends HList>
      HAppend, R, HCons> append(HAppend append) {
    return (left, right) -> HList.cons(left.head(), append.append(left.tail(), right));
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy