Skip to content

Instantly share code, notes, and snippets.

View therewillbecode's full-sized avatar

Tom therewillbecode

  • Edinburgh, UK
View GitHub Profile
@therewillbecode
therewillbecode / array.wat
Created April 14, 2019 17:12
Webassembly 32 bit Int Array Example
(module
(memory 1)
(func $load_num (param $index i32) (result i32)
(i32.mul (get_local $index) (i32.const 4))
i32.load
)
(func $store_num (param $index i32) (param $num i32)
(i32.mul (get_local $index) (i32.const 4))
get_local $num ;; value to store
i32.store
@therewillbecode
therewillbecode / adts.md
Last active December 11, 2017 20:39
Haskell Types

Introduction to Algebraic Data Types in Haskell

Constructor Functions vs Normal Functions

Constructor functions are the kinds of functions used to create types and values.

Constructor functions are different from normal functions in the sense that once they have had their arguments applied they are fully evaluated.

They have no equation or body so to speak. For example the value constructor Just 5 is a value just like 5 is except it has a different type.