Skip to content

Instantly share code, notes, and snippets.

View matheus23's full-sized avatar
🏸
.

Philipp Krüger matheus23

🏸
.
View GitHub Profile
@matheus23
matheus23 / AST.hs
Created December 15, 2018 23:27
Convert Elm Valid AST to Elm Format AST
{-# OPTIONS_GHC -Wall #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PackageImports #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE DuplicateRecordFields #-}
module Language.Elm.AST where
-- Elm format
@matheus23
matheus23 / elm-compiler.md
Created September 17, 2018 22:30
Describing the elm compiler architecture

The Elm Compiler Architecture

Common Datastructures

  • Elm.Compiler.Module.Raw is just an alias for Elm.Name.Name, which is a newtype wrapper around Data.Text.Text. Conceptually, a Module.Raw is ??? (is it canonicalized, or not?)

Understanding the Compiler Pipeline

@matheus23
matheus23 / Map.idr
Created July 23, 2018 16:41
Idris can't fill in obvious implicit argument
module Map
%access public export
%default total
||| A Map structured basically as an association list
data Map : (key : Type) -> (value : Type) -> Type where
Empty : Map k v
Insert : k -> v -> Map k v -> Map k v
Verifying my Blockstack ID is secured with the address 1DtAF6JVGu3ZC7Q5KonnmzczfRMWfuQZFL https://explorer.blockstack.org/address/1DtAF6JVGu3ZC7Q5KonnmzczfRMWfuQZFL
/*
* Copyright (c) 2013 matheusdev
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*