-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
simplicifiees LogicSeqT representation
- Loading branch information
Showing
2 changed files
with
87 additions
and
122 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 |
---|---|---|
@@ -1,16 +1,30 @@ | ||
package logic.logict | ||
|
||
import cps.CpsTryMonad | ||
|
||
|
||
// | ||
// TODO: (when find time) | ||
// implement version of LogiSeq with direct suspend (similar to haskell Control.Monad.Stream + LogicSeqT optimization) | ||
// | ||
|
||
sealed trait LogicMixStream[F[_],+A] { | ||
sealed trait LogicStream[F[_]:CpsTryMonad,A] { | ||
|
||
} | ||
|
||
object LogicMixStream { | ||
case object Empty extends LogicMixStream[?,Nothing] | ||
object LogicStream { | ||
|
||
case class Empty[F[_]:CpsTryMonad,A]() extends LogicStream[F,A] | ||
|
||
case class Pure[F[_]:CpsTryMonad,A](a:A) extends LogicStream[F,A] | ||
|
||
case class Error[F[_]:CpsTryMonad,A](e:Throwable) extends LogicStream[F,A] | ||
|
||
case class Cons[F[_]:CpsTryMonad,A](head:Try[A], tail: ()=>LogicStream[F,A]) extends LogicStream[F,A] | ||
|
||
case class WaitF[F[_]:CpsTryMonad,A](waited:F[LogicStream[F,A]]) extends LogicStream[F,A] | ||
|
||
case class Suspend[F[_]:CpsTryMonad,A](suspended: ()=>LogicStream[F,A]) extends LogicStream[F,A] | ||
|
||
|
||
} |