Search in sources :

Example 1 with Account

use of cyclops.typeclasses.taglessfinal.Cases.Account in project cyclops by aol.

the class TaglessFinal3Test method setup.

@Before
public void setup() {
    nt = new NaturalTransformation<identity, io>() {

        @Override
        public <T> Higher<io, T> apply(Higher<identity, T> a) {
            return IO.sync(Identity.narrowK(a));
        }
    };
    acc1 = new Account(10000d, 10);
    acc2 = new Account(0d, 11);
    prog = new Program3<>(IOInstances.monad(), new AccountIO(), new LogID(), nt, acc2, acc1);
}
Also used : Account(cyclops.typeclasses.taglessfinal.Cases.Account) DataWitness.identity(com.oath.cyclops.hkt.DataWitness.identity) DataWitness.io(com.oath.cyclops.hkt.DataWitness.io) Higher(com.oath.cyclops.hkt.Higher) Before(org.junit.Before)

Example 2 with Account

use of cyclops.typeclasses.taglessfinal.Cases.Account in project cyclops by aol.

the class TaglessFinal4Test method setup.

@Before
public void setup() {
    acc1 = new Account(10000d, 10);
    acc2 = new Account(0d, 11);
    StoreIO<Long, Account> store = new StoreIO<>();
    store.put(acc1.getId(), acc1);
    store.put(acc2.getId(), acc2);
    prog = new ProgramStore<>(IOInstances.monad(), new AccountIO2(store), acc2, acc1);
}
Also used : Account(cyclops.typeclasses.taglessfinal.Cases.Account) Before(org.junit.Before)

Example 3 with Account

use of cyclops.typeclasses.taglessfinal.Cases.Account in project cyclops by aol.

the class TaglessFinal2Test method setup.

@Before
public void setup() {
    acc1 = new Account(10000d, 10);
    acc2 = new Account(0d, 11);
    prog = new Program2<io>(IOInstances.monad(), new AccountIO(), new LogIO(), acc1, acc2);
}
Also used : Account(cyclops.typeclasses.taglessfinal.Cases.Account) DataWitness.io(com.oath.cyclops.hkt.DataWitness.io) Before(org.junit.Before)

Aggregations

Account (cyclops.typeclasses.taglessfinal.Cases.Account)3 Before (org.junit.Before)3 DataWitness.io (com.oath.cyclops.hkt.DataWitness.io)2 DataWitness.identity (com.oath.cyclops.hkt.DataWitness.identity)1 Higher (com.oath.cyclops.hkt.Higher)1