Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jake Donham
committed
Jun 2, 2011
1 parent
f2a6e8f
commit 7ece415
Showing
6 changed files
with
48 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
trait LogicForgetState extends Logic { | ||
val LogicState: LogicState | ||
|
||
type T[A] = LogicState.T[Unit,A] | ||
|
||
def fail[A]: T[A] = LogicState.fail | ||
def unit[A](a: A): T[A] = LogicState.unit(a) | ||
def or[A](t1: T[A], t2: => T[A]): T[A] = LogicState.or(t1, t2) | ||
def bind[A,B](t: T[A], f: A => T[B]): T[B] = LogicState.bind(t, f) | ||
def apply[A,B](t: T[A], f: A => B): T[B] = LogicState.apply(t, f) | ||
def filter[A](t: T[A], p: A => Boolean): T[A] = LogicState.filter(t, p) | ||
def split[A](t: T[A]): Option[(A,T[A])] = { | ||
LogicState.split((), t) match { | ||
case None => None | ||
case Some((_, a, t)) => Some(a, t) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters