fp

Published

Tags

Writing a VSCode extension with Fable 2.1

Introduction This post is part of the F# Advent Calendar in English 2018. I’m very grateful to be a part of this and I hope you will enjoy this one as much as I have enjoyed the others. Today I would like to show you how you can create VS Code extension from scratch using Fable. Along the way we write some code that will extend the Markdown syntax. Project setup Code extension To get started we will follow the general approach of scaffolding a new extension. Using the yeoman generator we will scaffold a new JavaScript extension. Adding Fable In order to…

Published

Tags

React hooks preview with Fable

Introduction A couple of weeks ago Facebook presented React hooks, a new way of accessing React features inside functional components. In this blogpost I would like to show that the new hooks can easily be used in combination with Fable. Disclaimer: Hooks are an experimental proposal to React, currently available in , and the api is not final yet. Use at your own risk. useState() A first example of a hook is useState(). When the hook is called, we receive a variable representing the state and a function to update the state. Example: Note that accepts a…

Published

Tags

Adventures in Elm

Introduction 2016 for me personal was the year the I came in serious contact with functional languages. I started looking at F#, applied functional concepts (partial application, immutability, pure functions and so on) in JavaScript, gave RxJS a shot and fell in love with React. A logical next step was looking at Elm. I was first introduced to Elm at a Socrates Meetup a while ago by Thomas Coopman. To be honest I was a bit overwhelmed at the time and a bit skeptical afterwards. I decided to give Elm another shot and learned a lot by following Elm for…