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 is from hobby project which partially is based on | |
https://play.kotlinlang.org/hands-on/Building%20Web%20Applications%20with%20React%20and%20Kotlin%20JS/01_Introduction | |
//hobby project is https://github.com/neeffect/kotlin-stones (it is in fact playground - nothing serious) | |
// I had classic get operation from rest (in kotlinjs) | |
//original method | |
suspend fun fetchStones(): List<Stone> = coroutineScope { | |
window.fetch("/api/stones") | |
.await() |
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
fibbtcoinner 0 sum presum = sum | |
fibbtcoinner n sum presum = fibbtcoinner (n-1) (sum + presum) sum | |
fibbtco n = fibbtcoinner n 1 0 | |
fibbnaive 0 = 1 | |
fibbnaive 1 = 1 | |
fibbnaive n = fibbnaive ( n-1) + fibbnaive ( n - 2) | |
main = do |
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
fibbtcoinner 0 sum presum = sum | |
fibbtcoinner n sum presum = fibbtcoinner (n-1) (sum + presum) sum | |
fibbtco n = fibbtcoinner n 1 0 | |
fibbnaive 0 = 1 | |
fibbnaive 1 = 1 | |
fibbnaive n = fibbnaive ( n-1) + fibbnaive ( n - 2) | |
main = do |
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
package pl.rm | |
import akka.actor.ActorSystem | |
import akka.stream.scaladsl.{GraphDSL, RunnableGraph, Source, ZipWithN} | |
import akka.stream.{ActorMaterializer, ClosedShape} | |
import scala.concurrent.{Await, Future} | |
import scala.concurrent.duration._ | |
object AveragePrice { |