Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions essence-of-live-coding/src/LiveCoding/Forever.lhs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import LiveCoding.Cell
import LiveCoding.Exceptions
import LiveCoding.CellExcept
import LiveCoding.LiveProgram
import LiveCoding.Exceptions.Finite (commute, Finite)

\end{code}
\end{comment}
Expand Down Expand Up @@ -141,3 +142,20 @@ Let us run it:

\fxerror{``Forever and ever?'' Show graceful shutdown with ExceptT. Have to change the runtime slightly for this.}
\fxnote{Awesome idea: Electrical circuits simulation where we can change the circuits live!}

\begin{comment}
\begin{code}
foreverCE :: (Monad m, Data e, Finite e) =>
e ->
(e -> CellExcept a b m e) ->
Cell m a b
foreverCE e f = foreverE e $ commute $ runCellExcept . f

foreverCE' ::
(Monad m, Data void, Finite void, Data e, Finite e) =>
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could avert the constraints on void by plugging in Void instead. Weird it's necessary at all. Have a look again whether I can get rid of them, and write a test just to see whether they are a nuisance.

e ->
(e -> CellExcept a b m e) ->
CellExcept a b m void
foreverCE' e = try . liftCell . foreverCE e
\end{code}
\end{comment}