Harfang's Perch

  • Posts
  • About
  • RSS
  • Atom
  • English
  • 한국어
  • How to Trigger Multiple Msgs in Elm

    2019-01-13

    In the Elm Architecture, update function is responsible for changing Model state. Depending on how you structure your Model, Msg, and update, sometimes you may want to call update function again with another Msg after calling update function. Recursively calling update is straightforward.

    Read more
  • How to Organize Port Functions in Elm

    2018-12-19

    I’ve been thinking about how to organize Elm’s port functions and here’s two approaches that I’ve put together. I assume that the readers know basics of Elm, including the Elm Architecture and how ports work. I put a working Elm app example in my Github repository. If you want to run it, follow this instruction to set it up:

    Read more
  • How to Display Entire Text in Elm Debugger

    2018-07-29

    Elm Debugger is one of the most amazing debugging tools I’ve ever used - too bad I rarely get to use it because Elm makes it so difficult to produce serious bugs. The Debugger places a limit on the length of displayable text in it, and truncates any text or data structure that might go over that limit. It’s a sensible default, but sometimes it hampers my debugging effort especially when I’m trying to see the exact message I’ve received. Here’s an example of how the it truncates messages in Richard Feldman’s RealWorld example app:

    Read more
  • Using Korean in Spacemacs

    2018-07-22

    I’ve started trying out Emacs because I lost patience while trying to set up Haskell development environment in Vim. Some random person on the Internet suggested Spacemacs as an alternative, so I decided to give it a try. So far I’m liking it - it works out of box without much configuration. Unfortunately the documentation on setting up Korean language environment was a bit outdated and/or fragmented for an Emacs newbie like me to easily understand. After some researching I’ve come up with a working configuration so I’ll share it here. I’m using D2Coding font, but feel free to use whatever you like.

    I’m using Ubuntu 16.04.4 and Emacs 26.1.

    Read more
  • Why I Find CSS So Hard

    2018-07-14

    Once I heard someone half-jokingly say that he finds CSS harder than Haskell. At the time I just laughed at the joke, but after working with CSS for some time I now understand what he meant. CSS is complex. While it has simple syntax and structure, its output depends so much on the runtime context that it’s hard to reliably predict the result.

    Three Problems

    For me, three issues stood out:

    1. Difficult to determine which CSS rule is finally applied
    2. Difficult to know how CSS rules interact
    3. Difficult to guess the runtime environment
    Read more
  • Thoughts on Safer Smart Contracts Through Type-Driven Development

    2018-02-18

    Introduction

    Last year, I learned of the Idris language and wrote a blog post after reading a book on it. Coincidentally, I joined a company that worked on blockchain technology almost immediately after publishing that post. So when I came across a paper titled “Safer smart contracts through type-driven development: Using dependent and polymorphic types for safer development of smart contracts”, which combined two topics of my interest, I just had to read it.

    This post is a collection of the thoughts that came across my mind while I was reading the paper. There won’t be any new idea that builds on the contents of the paper. I assume basic understanding of functional programming paradigm, in particular the distinction between pure functions and side effects.

    Read more
  • A Short Guide to Function Operators in Elm (|>, <|, >>, <<)

    2018-01-28

    Summary

    Once we get through the introduction to Elm, we start to encounter some odd-looking operators in Elm codes. I’m talking about the ones like >>, <<, |>, and <|, which modify how functions are composed and applied. I will give more details about how and when I use them in this post, but here’s my rule of thumb:

    1. Use |> and <| to visually describe the flow of data. It’s their main advantage over nested parantheses, which provide equivalent functionalities.

    2. Use >> and << to describe function compositions independent of the data flow. In practice, I usually define a new function through composition and use it with |> and <|.

    3. Use either the pair of |> and >> or <| and << without mixing them. The shapes of these operators hold inherent directional meanings, so mixing different directions taxes our cognitive resources.

    Read more
  • Interview With Rich Hickey by Michael Fogus

    2017-12-09

    Preface

    This interview with Rich Hickey, the creator of Clojure language, was conducted by Michael Fogus on CodeQuarterly. All credit should be given to him. I’m posting it here for two reasons:

    1. Preservation

    CodeQuarterly is gone, so I wanted to create another copy of this interesting and insightful interview to preserve it.

    1. Original Text for Korean Translation

    I wanted to provide the original English text for readers of my Korean translation in case they wanted to reference the primary source.

    Read more
  • Type-Driven Development with Idris - Review

    2017-10-23

    Summary

    Type-Driven Development with Idris introduces a software development approach that uses types as the primary tool for building softwares. In this paradigm, types are given much more responsibilities than their traditional role of checking data validity. For example, types can be used to represent the input and output states of functions or various contracts that functions and datas must fulfill. Such descriptions and contracts are enforced at compile time, providing much stronger guarantee of software correctness at compile time than other approaches can.

    Idris programming language is used in the book to teach type-driven development (TDD). Idris is a general purpose pure functional programming language created by Edwin Brady, who is also the author of this book. Idris is inspired by Haskell and ML and sports a state of the art type system suited for TDD. You will learn basics of Idris language alongside TDD in this book.

    Read more
  • How to Bake Pi - Review

    2017-09-08

    Summary

    How to Bake Pi: an Edible Exploration of the Mathematics of Mathematics explores what mathematics is about by explaining the purpose and building blocks of mathematics in an easy-to-read language, drawing examples from everyday life, including baking.

    I recommend it to you if you have never learned abstract mathematics but would like an introduction to it written in a way that even normal human beings can understand.

    I do not recommend this book if you want to learn category theory or its application to software development. This book will give you an overview of what category theory is about, but will not teach you anything in depth about category theory. In terms of category theory textbook, the contents of this book would fit in as an extended introduction chapter.

    Read more
1 2 3 4 5 6