Class SingletonHList<_1>

    • Constructor Detail

      • SingletonHList

        SingletonHList​(_1 _1)
    • Method Detail

      • cons

        public <_0> Tuple2<_0,​_1> cons​(_0 _0)
        Cons an element onto the front of this HList.
        Overrides:
        cons in class HList.HCons<_1,​HList.HNil>
        Type Parameters:
        _0 - the new head type
        Parameters:
        _0 - the new head element
        Returns:
        the updated HList
      • snoc

        public <_2> Tuple2<_1,​_2> snoc​(_2 _2)
        Snoc an element onto the back of this SingletonHList.
        Type Parameters:
        _2 - the new last element type
        Parameters:
        _2 - the new last element
        Returns:
        the new Tuple2
      • zip

        public <_1Prime> SingletonHList<_1Prime> zip​(Applicative<Fn1<? super _1,​? extends _1Prime>,​SingletonHList<?>> appFn)
        Given another instance of this applicative over a mapping function, "zip" the two instances together using whatever application semantics the current applicative supports.
        Specified by:
        zip in interface Applicative<_1,​SingletonHList<?>>
        Specified by:
        zip in interface Monad<_1,​SingletonHList<?>>
        Specified by:
        zip in interface MonadRec<_1,​SingletonHList<?>>
        Type Parameters:
        _1Prime - the resulting applicative parameter type
        Parameters:
        appFn - the other applicative instance
        Returns:
        the mapped applicative
      • lazyZip

        public <_1Prime> Lazy<SingletonHList<_1Prime>> lazyZip​(Lazy<? extends Applicative<Fn1<? super _1,​? extends _1Prime>,​SingletonHList<?>>> lazyAppFn)
        Given a lazy instance of this applicative over a mapping function, "zip" the two instances together using whatever application semantics the current applicative supports. This is useful for applicatives that support lazy evaluation and early termination.
        Specified by:
        lazyZip in interface Applicative<_1,​SingletonHList<?>>
        Specified by:
        lazyZip in interface Monad<_1,​SingletonHList<?>>
        Specified by:
        lazyZip in interface MonadRec<_1,​SingletonHList<?>>
        Type Parameters:
        _1Prime - the resulting applicative parameter type
        Parameters:
        lazyAppFn - the lazy other applicative instance
        Returns:
        the mapped applicative
        See Also:
        Maybe, Either
      • flatMap

        public <_1Prime> SingletonHList<_1Prime> flatMap​(Fn1<? super _1,​? extends Monad<_1Prime,​SingletonHList<?>>> f)
        Chain dependent computations that may continue or short-circuit based on previous results.
        Specified by:
        flatMap in interface Monad<_1,​SingletonHList<?>>
        Specified by:
        flatMap in interface MonadRec<_1,​SingletonHList<?>>
        Type Parameters:
        _1Prime - the resulting monad parameter type
        Parameters:
        f - the dependent computation over A
        Returns:
        the new monad instance
      • traverse

        public <B,​App extends Applicative<?,​App>,​TravB extends Traversable<B,​SingletonHList<?>>,​AppTrav extends Applicative<TravB,​App>> AppTrav traverse​(Fn1<? super _1,​? extends Applicative<B,​App>> fn,
                                                                                                                                                                                             Fn1<? super TravB,​? extends AppTrav> pure)
        Apply fn to each element of this traversable from left to right, and collapse the results into a single resulting applicative, potentially with the assistance of the applicative's pure function.
        Specified by:
        traverse in interface Traversable<_1,​SingletonHList<?>>
        Type Parameters:
        B - the resulting element type
        App - the result applicative type
        TravB - this Traversable instance over B
        AppTrav - the full inferred resulting type from the traversal
        Parameters:
        fn - the function to apply
        pure - the applicative pure function
        Returns:
        the traversed Traversable, wrapped inside an applicative
      • into

        public <R> R into​(Fn1<? super _1,​? extends R> fn)
        Apply HList.HCons.head() to fn and return the result.
        Type Parameters:
        R - the return type of the function
        Parameters:
        fn - the function to apply
        Returns:
        the result of applying the head to the function