This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# OPTIONS -Wall #-} | |
module LL (empty, append, index, delete) where | |
import Control.Concurrent.STM | |
data Node a = Node a (LinkedList a) | |
type LinkedList a = TVar (Maybe (Node a)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# OPTIONS -Wall #-} | |
{-# LANGUAGE GADTs, DataKinds, KindSignatures, RankNTypes, | |
FlexibleInstances, PolyKinds, ScopedTypeVariables #-} | |
module Utils where | |
import Data.Int | |
import Foreign.Ptr | |
import Foreign.Storable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# OPTIONS -Wall #-} | |
{-# LANGUAGE GADTs, DataKinds, TemplateHaskell, KindSignatures, | |
MultiParamTypeClasses, RankNTypes, PolyKinds, FlexibleContexts, | |
TypeFamilies, UndecidableInstances, FlexibleInstances #-} | |
module Effects where | |
import Data.Singletons |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Bar where | |
type A = { x : Int, y : Int } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{- | |
- This is the loop function that I propose as an ehancement. | |
- I think it's better because the asychonous loopback signal | |
- is anonymous, rather than a top-level definition. | |
-} | |
loop : (b -> a) -> b -> (Signal a -> Signal b) -> Signal b | |
-- Here's how we're going to control our little demo | |
powerButton : Element | |
power : Signal Bool |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mayer.John.Native.Loop = function(elm) { | |
// Various boilerplate stuff | |
'use strict'; | |
if (elm.Native.Loop) return elm.Native.Loop; | |
var Signal = Elm.Signal(elm); | |
// This is the unsafe loop construct | |
// loop : (b -> a) -> (Signal a -> Signal b) -> b -> Signal b | |
var loop = function(convert, transform, initial) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Loop where | |
import Graphics.Input (checkbox) | |
-- compiler note, impossible to put a valid type signature here | |
-- check : Signal Element | |
-- power : Signal Bool | |
(check, power) = checkbox true | |
tick : Signal Time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[1 of 5] Compiling Vec2 ( Vec2.elm ) | |
Type error on line 31: | |
{x = v.x, y = v.y} | |
Expected Type: a | |
Actual Type: {} | |
Type error on line 34: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern crate sync; | |
use sync::Arc; | |
use sync::Mutex; | |
static N : uint = 5; | |
fn philosopher(seat : uint, vec : &Arc<Vec<Mutex<()>>>) { | |
let leftFork = seat; | |
let rightFork = (seat + 1) % N; | |
println!("Philosopher {} {} {}", seat, leftFork, rightFork); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Assumes the following are available | |
# | |
# jq | |
curl https://api.github.com/users/johnpmayer/keys |
OlderNewer