Copyright 2008 - 2010 Tony Morris, Runar Bjarnason, Tom Adams, Brad Clow, Ricky Clarkson, Nick Partridge, Jason Zaugg

This software is released under an open source BSD licence.

fj
Class Effect<A>

java.lang.Object
  extended by fj.Effect<A>

public abstract class Effect<A>
extends java.lang.Object

Represents a side-effect.


Constructor Summary
Effect()
           
 
Method Summary
<B> Effect<B>
comap(F<B,A> f)
          A contra-variant functor on effect.
 F<A,Unit> e()
          Returns a function for the given effect.
abstract  void e(A a)
           
static
<A> Effect<A>
f(F<A,Unit> f)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Effect

public Effect()
Method Detail

e

public abstract void e(A a)

e

public final F<A,Unit> e()
Returns a function for the given effect.

Returns:
The function using the given effect.

comap

public final <B> Effect<B> comap(F<B,A> f)
A contra-variant functor on effect.

Parameters:
f - The function to map over the effect.
Returns:
An effect after a contra-variant map.

f

public static <A> Effect<A> f(F<A,Unit> f)

Copyright 2008 - 2010 Tony Morris, Runar Bjarnason, Tom Adams, Brad Clow, Ricky Clarkson, Nick Partridge, Jason Zaugg

This software is released under an open source BSD licence.