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
using System.Windows; | |
using System.Windows.Controls; | |
using System.Windows.Interactivity; | |
using System.Windows.Media; | |
using Microsoft.Phone.Controls; | |
namespace PhoneApp1 | |
{ | |
public class PanAndZoomBehavior : Behavior<FrameworkElement> | |
{ |
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 won't really compile and is a rather ungeneralized example only to get you familiar with the syntax. | |
MealyMachine<State, Element, Option<Translation>> parser = MealyMachine.fromTransitions( | |
State.BEFORE, | |
when(State.BEFORE).then(lookOutForSourceLangHeader(source)), | |
when(State.IN_SECTION).then(lookOutForDirectHitsHeader), | |
when(State.IN_DIRECT_HITS).then(parseDirectHits(source)), | |
when(State.FINISHED).then(doNothing) | |
); | |
private enum State { |
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
// The structure of this document: | |
// 1. 'Define' the initial data type hierarchy | |
// (Integer expression trees with literals only initially, so rather a leaf) | |
// 2. Extend with an evaluation operation | |
// 3. Extend with a branching Add expression | |
// 4. Extend the evaluation operation to work on Add expressions | |
// 1. Define the data type hierarchy, expression trees. | |
// The paper's example is more fleshed out, | |
// this is the bare minimum. |
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
import Reverse | |
import Prelude hiding (reverse) | |
main :: IO () | |
main = print $ reverse [1, 2, 3] |
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
ds = desugared?! some expression determined to be shared | |
$w<wrapper> = worker from a WW transform | |
$d<class><type> = dictionary parameter | |
$dm<method> = default method definition | |
$f<class><type> = concrete instance dictionary definition | |
$p<i><class> = ith dictionary selector | |
$c<method> = instance method definition, later to be bound to a $f?! | |
$trModule = module definitions | |
$s<fun> = ? specialization? |
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
{-# LANGUAGE AllowAmbiguousTypes #-} | |
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
{-# LANGUAGE TypeApplications #-} | |
{-# LANGUAGE TypeFamilies #-} | |
module Algebra where |
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
{-# LANGUAGE AllowAmbiguousTypes #-} | |
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
{-# LANGUAGE TypeApplications #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE UndecidableInstances #-} |
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
==================== Tidy Core ==================== | |
2018-02-23 13:10:24.831160667 UTC | |
Result size of Tidy Core | |
= {terms: 763, types: 933, coercions: 17, joins: 10/34} | |
-- RHS size: {terms: 13, types: 16, coercions: 0, joins: 0/0} | |
Main.$WMkStream [InlPrag=INLINE[2]] | |
:: forall a s. (s -> Step s a) -> s -> Stream 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
module Main (main) where | |
import System.Environment (getArgs) | |
import Control.Monad (when, forM_) | |
import GHC.ST | |
nop :: Monad m => a -> m () | |
nop _ = return () | |
{-# NOINLINE nop #-} |
OlderNewer