fregefx - javafx with frege, a haskell for the jvm
TRANSCRIPT
Adventures with Extreme Types in a Purely Functional Language
FregeFX: Pure Functions andExplicit Effects for JavaFXJavaOne 2016
Extreme Typespurefunctionscannotproduceaneffect
butwehaveto!
->produceactionsthattellwhattodo(likearecipe)
actionsareofaspecialtype,e.g.IOactionsorJFXactions
Extreme Typesmakeimplicitconstraintsexplicit
JavaFX:onlytouchnodesinsideUIthreadonlydoIOoutsideUIthread
Lesstrickyerrors
pure native encode java.net.URLEncoder.encode :: String -> String encode “Dierk König“
native println System.out.println :: String -> IO () println “Dierk König“ native getText :: TextInputControl -> JFX String text <- inputField.getText println text - - does not compile! inIO text println - - compiles!
Native Declarations
Entry Points IThe github projecthttps://github.com/Frege/FregeFX
The tutorial that uses FregeFX to build a cover-flow galleryhttps://github.com/Dierk/fregeTutorial
FregeChat, client written in FregeFXhttps://github.com/Dierk/FregeChat
Entry Points IIGui of the Frege REPL, written in FregeFXhttps://github.com/Dierk/frepl-gui
some videos- https://www.youtube.com/watch?v=pxKJ_KPLml- https://www.youtube.com/watch?v=9V7w-RSC_1A
Unique in FregeGlobal type inference (requires purity)Purity by default effects are explicit in the type systemType-safe concurrency & parallelismLaziness by defaultValues are always immutable Guarantees extend into Java calls