I am finally giving up thinking about Haskell mtl way, instead, I decide to 
try kilim and akka in Frege, I feel like Frege is an universal glue which 
greatly mitigate my bad feeling by direct programming on Java. I am 
currently leading an effort to put Frege on our production environment, our 
team only have scheme programming experience before, they are really 
accustomed to REPL and Emacs programming environment. I develop an simple 
dex code dynamically loading mechanism,  so that we can use Emacs Haskell 
mode to edit Frege code and one key binding to translate into dex jar and 
loaded by the Frege activity program. Saving a lot of time watching grandle 
building process. With this machinery, I rewrite a lot of android code on 
the fly, the USB code, the RSA code, the networking code, the DateBase 
access code. But when I came to serial port code, I need coroutine just 
like I did it on gambit-c scheme. Although nobody reports that kilim can 
ever been ported to android, but I think it is just the proguard 
configuration thing

在 2017年11月17日星期五 UTC+8下午6:41:26,Dierk Koenig写道:
>
> Cool. 
> You can just use “data” in replacement of “newtype”. It makes no 
> difference to the generated code. 
>
> It would be cool to hear more about your project!
>
> Cheers
> Dierk
>
> sent from:mobile 
>
> Am 17.11.2017 um 11:13 schrieb zhou...@163.com <javascript:>:
>
> In scheme, I can implement my co-routine by defining a function like this:
>
> (define (spawn prog)
>  (call/cc
>   (lambda (start)
>     (let ((suspend (lambda ()
>                (call/cc
>                 (lambda (k)
>                       (start k))))))
>       (prog suspend)))))
>
> Recently I use Frege to program android, I notice that  Control.Monad.Cont 
> is not available, I try to define it follow the book 
> https://en.wikibooks.org/wiki/Haskell/Continuation_passing_style
>
> newtype Cont r a = Cont { runCont :: ((a -> r) -> r) } -- r is the final 
> result type of the whole computation 
>  
> instance Monad (Cont r) where 
>     return a       = Cont $ \k -> k a                       -- i.e. return a 
> = \k -> k a 
>     (Cont c) >>= f = Cont $ \k -> c (\a -> runCont (f a) k) -- i.e. c >>= f = 
> \k -> c (\a -> f a k)
>
>
> But no luck, 'newtype' is not supported by Frege
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Frege Programming Language" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to frege-programming-language+unsubscr...@googlegroups.com 
> <javascript:>.
> For more options, visit https://groups.google.com/d/optout.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Frege Programming Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to frege-programming-language+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to