- Sixth Summer School on Formal Techniques / 22-27 May
- Twelfth International Summer School on Advanced Computer Architecture and Compilation for High-Performance and Embedded Systems / 10-16 July 2016
- Oregon Programming Languages Summer School / 20 June-2 July 2016
- The 6th Halmstad Summer School on Testing / 13-16 June, 2016
- Second International Summer School on Behavioural Types / 27 June-1 July 2016
- Virtual Machines Summer School 2016 / 31 May - 3 June 2016
- ECOOP 2016 Summer School
let recv = (client, maxlen) => { | |
let bytes = Bytes.create(maxlen); | |
let len = Unix.recv(client, bytes, 0, maxlen, []); | |
Bytes.sub_string(bytes, 0, len) | |
}; | |
let parse_top = top => { | |
let parts = Str.split(Str.regexp("[ \t]+"), top); | |
switch (parts) { |
#!/usr/bin/env stack | |
-- stack --resolver lts-10.0 script | |
{-# LANGUAGE OverloadedStrings #-} | |
import Text.XML | |
import qualified Data.Map.Strict as Map | |
main :: IO () | |
main = do | |
Document x (Element n a nodes) y <- Text.XML.readFile def "foo.html" | |
Text.XML.writeFile def "foo2.html" $ Document x (Element n a $ concatMap goN nodes) y |
/** | |
* Making promises | |
*/ | |
let okPromise = Js.Promise.make((~resolve, ~reject as _) => [@bs] resolve("ok")); | |
/* Simpler promise creation for static values */ | |
Js.Promise.resolve("easy"); | |
Js.Promise.reject(Invalid_argument("too easy")); |
{-# LANGUAGE DeriveGeneric #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
module Main where | |
import Data.Foldable (for_) | |
import Data.Traversable (for) | |
import Control.Monad.IO.Class | |
-- build-depends: base, haskeline, optparse-applicative | |
-- -- for example parser |
module type Monad = sig | |
type 'a t | |
val return: 'a -> 'a t | |
val bind: 'a t -> ('a -> 'b t) -> 'b t | |
end |
- https://github.com/arnarthor/advent-of-code-2017 (Native & BuckleScript)
- https://github.com/rrdelaney/advent-of-code-2017 (Native)
- https://github.com/fazouane-marouane/advent-of-code-2017 (BuckleScript)
- https://github.com/jaredly/advent-2017 (BuckleScript)
- https://github.com/brentbaum/advent-of-code (BuckleScript)
- https://github.com/Lokeh/advent-2017 (BuckleScript)
I had always been confused by Haskell's implementation of existential types. Until now!
Existential types is the algebraic data type (ADT) equivalent to OOP's data encapsulation. It's a way of hiding a type within a type. Hiding it in such a way that any consumer of the data type won't have any knowledge on the internal property
13:15 <xQuasar> | HASKELL IS FOR FUCKIN FAGGOTS. YOU'RE ALL A BUNCH OF | |
| FUCKIN PUSSIES | |
13:15 <xQuasar> | JAVASCRIPT FOR LIFE FAGS | |
13:16 <luite> | hello | |
13:16 <ChongLi> | somebody has a mental illness! | |
13:16 <merijn> | Wow...I suddenly see the error of my ways and feel | |
| compelled to write Node.js! | |
13:16 <genisage> | hi | |
13:16 <luite> | you might be pleased to learn that you can compile | |
| haskell to javascript now |
Often when writing programs and functions, one starts off with concrete types that solve the problem at hand. At some later time, due to emerging requirements or observed patterns, or just to improve code readability and reusability, we refactor to make our code more polymorphic. The importance of not breaking your API typically ranges from nice to have (e.g. minimises rework but not essential) to paramount (e.g. in a popular, foundational library).