Skip to content
This repository has been archived by the owner on May 16, 2021. It is now read-only.
/ dotty-frp Public archive

Martin Odersky FRP rewritten with implicit function type and Sodium semantic

Notifications You must be signed in to change notification settings

newca12/dotty-frp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Some experiments with Dotty, FRP and Sodium semantics

About

In coursera course Functional Program Design in Scala Martin Odersky show a sample FRP implementation. You can see the summary here.

At the end of the lecture 4.3 some ideas for improvements where given :

There's actually another possible solution, which is much cleaner and that is to simply pass down the current caller into all the signal-valued expressions. Now if we do that explicitly, it would produce a lot of overhead. Essentially, every signal-valued expression has to have another parameter and these parameters have to be threaded through everything. But if you make the parameter implicit, then a lot of that burden can actually be avoided. So the idea is that instead of maintaining a thread-local variable, we pass its current value into a signal expression as an implicit parameter. And it's purely functional, but it currently requires still some more boiler plate than the thread-local solution because essentially expressions have to close, have to take this implicit value as a parameter. Future versions of Scala might actually solve that problem, so we're currently tinkering with some ideas how that could be streamlined.

The idea was demonstrated in this talk "Plain Functional Programming" by Martin Odersky at Devoxx 2017

This dotty feature is called Context queries. (previously named implicit function types)

This WIP is an attempt to implement a Sodium FRP implementation with implicit function types.

A taste of "Implicit Function Types"

Resources

About

Martin Odersky FRP rewritten with implicit function type and Sodium semantic

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages