Package frege.runtime

Examples of frege.runtime.Lambda.apply()


   * @return the new state
   */
  public static TGlobal runSTIO(Lazy action, TGlobal g) {
    Lambda stg = Delayed.<Lambda>forced(action);        // StateT (g -> IO (a, g))
    Lambda r   = Delayed.<Lambda>forced( TStateT.run(stg, g));
    TTuple2 t  = r.apply(42).result().<TTuple2>forced();
    return Delayed.<TGlobal>forced(t.mem2);
  }
 
  /**
   * Run a {@link frege.prelude.PreludeBase.TState} action and return the result.
View Full Code Here


   * @return the result
   */
  public static Object funSTIO(Lazy action, TGlobal g) {
    Lambda stg = Delayed.<Lambda>forced(action);        // StateT (g -> IO (a, g))
    Lambda r   = Delayed.<Lambda>forced( TStateT.run(stg, g));
    TTuple2 t  = r.apply(42).result().<TTuple2>forced();
    return t.mem1;
  }

  /**
   * @param filePath    Project-relative path of file
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.