Skip to content

Instantly share code, notes, and snippets.

View supermario's full-sized avatar
✌️

Mario Rogic supermario

✌️
View GitHub Profile
@supermario
supermario / example.hs
Created October 15, 2015 12:16
lens + maybe
data Box = Box { _value :: Integer }
data World = World { _box :: Maybe Box }
makeLenses ''Box
makeLenses ''World
steps :: StateT World IO ()
steps = do
box.value %= succ
@supermario
supermario / output.txt
Last active December 27, 2015 05:25
Pulp build issues
$ pulp init
* Generating project skeleton in /Users/mario/Dropbox/dev/test/sentiment
bower purescript-console#^0.1.0 cached git://github.com/purescript/purescript-console.git#0.1.1
bower purescript-console#^0.1.0 validate 0.1.1 against git://github.com/purescript/purescript-console.git#^0.1.0
bower purescript-eff#^0.1.0 cached git://github.com/purescript/purescript-eff.git#0.1.2
bower purescript-eff#^0.1.0 validate 0.1.2 against git://github.com/purescript/purescript-eff.git#^0.1.0
bower purescript-prelude#^0.1.0 cached git://github.com/purescript/purescript-prelude.git#0.1.3
bower purescript-prelude#^0.1.0 validate 0.1.3 against git://github.com/purescript/purescript-prelude.git#^0.1.0
bower purescript-console#^0.1.0 install purescript-console#0.1.1
bower purescript-eff#^0.1.0 install purescript-eff#0.1.2
@supermario
supermario / spec.md
Created May 19, 2016 12:58
Toy Robot

Specification

The original specification for the 'Toy Robot' challenge.

Description

  • The application is a simulation of a toy robot moving on a square tabletop, of dimensions 5 units x 5 units.
  • There are no other obstructions on the table surface.
  • The robot is free to roam around the surface of the table, but must be prevented from falling to destruction. Any movement that would result in the robot falling from the table must be prevented, however further valid movement commands must still be allowed.
$ ping slack.com
PING slack.com (52.222.233.130): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
Request timeout for icmp_seq 2
^C
--- slack.com ping statistics ---
4 packets transmitted, 0 packets received, 100.0% packet loss
# mario ~ 10:07:23
@supermario
supermario / Makefile
Created December 8, 2016 20:22
Pretty make help
somecommand: #App# Description of some command
somebashcommand
someothercommand: #Development# Description of some other command
someotherbashcommand
help:
@./scripts/makefile-help.sh ./Makefile
.DEFAULT_GOAL := help
@supermario
supermario / RandomOrg.elm
Created June 26, 2021 13:52
RandomOrg.elm
module RandomOrg exposing (..)
import Http
import Json.Decode as D
import Prng.Uuid as Uuid
import Process
import Random.Pcg.Extended as Random
import Task exposing (Task)
@supermario
supermario / readme.md
Last active March 21, 2022 15:07
Elm code splitting and the impact of dead-code-elimination

The question of code-splitting in Elm comes up fairly routinely.

The apparent low-hanging-fruit of code-splitting with Elm's pure/immutable philosophy has led me to explore this a few times with my compiler work on Lamdera.

Here are some of the challenges I've found:

The impact of Elm's current live-code-inclusion (LCI?)

It's a little trickier than it looks because Elm's DCE is actually not DCE (dead code elimination) at all, it's LCI (live code inclusion).