This library is a port of Haskell's lens. The goal is to provide functional lenses, isomorphisms, getters and setters.
This file contains hidden or 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
Unpackaged ghc-lens deps: | |
BuildRequires: ghc-bifunctors-devel # | |
BuildRequires: ghc-comonad-devel # | |
BuildRequires: ghc-contravariant-devel #1075598 | |
BuildRequires: ghc-distributive-devel #1075605 | |
BuildRequires: ghc-exceptions-devel #1075601 | |
BuildRequires: ghc-profunctors-devel # | |
BuildRequires: ghc-reflection-devel #1076737 |
This file contains hidden or 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 where | |
import System.ZMQ | |
import Control.Monad (replicateM, forever) | |
import qualified Data.ByteString | |
import Text.Printf | |
type Topics = [String] | |
type MessageHandler = (Data.ByteString.ByteString -> IO ()) | |
subscribeTopics :: SubsType a => Topics -> Socket a -> IO () |
This file contains hidden or 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 MultiParamTypeClasses #-} | |
{-# LANGUAGE PolyKinds #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE ConstraintKinds #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE KindSignatures #-} | |
{-# LANGUAGE RankNTypes #-} | |
{-# LANGUAGE UndecidableInstances #-} | |
{-# LANGUAGE ScopedTypeVariables #-} |
This file contains hidden or 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
;;Small minor mode to control spotify from emacs | |
(defun spotify-play () "Play Spotify" (interactive) | |
(shell-command "dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Play")) | |
(defun spotify-pause () "Pause Spotify" (interactive) | |
(shell-command "dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Pause")) | |
(defun spotify-playpause () "Play/Pause Spotify" (interactive) | |
(shell-command "dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause")) |
- "The Fifth Discipline", by Peter Senge (http://amzn.to/H7R4fp)
- "Lean Thinking", by James Womack (http://amzn.to/H7R9zK)
- "The Logic of Failure", by Dietrich Dorner (http://amzn.to/HyheLM)
- "Drift Into Failure", by Sidney Dekker (http://amzn.to/HpB8Fe)
- "Documenting Software Architecture", by Paul Clements (http://amzn.to/H7RtOP)
This file contains hidden or 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
-- e | |
> let z a b c d w@(x:y)=let t=a`div`c in if all(>0)[a,b,c,d]&&t==b`div`d then t:z(10*(a-c*t))(10*(b-d*t))c d w else z(x*a+b)a(x*c+d)c y;f n=1:1:n:f(n+2)in z 1 0 0 1(2:1:2:f 4)>>=show | |
> let z a b c d w@(x:y)|t<-a`div`c=if all(>0)[a,b,c,d]&&t==b`div`d then t:z(10*(a-c*t))(10*(b-d*t))c d w else z(x*a+b)a(x*c+d)c y;f n=1:1:n:f(n+2)in z 1 0 0 1(2:1:2:f 4)>>=show | |
> let z a b c d w@(x:y)|all(>0)[a,b,c,d]&&t==b`div`d|True=t:z(10*(a-c*t))(10*(b-d*t))c d w else z(x*a+b)a(x*c+d)c y where t=a`div`c;f n=1:1:n:f(n+2)in z 1 0 0 1(2:1:2:f 4)>>=show | |
> let z a b c d w@(x:y)|all(>0)[a,b,c,d]&&t==b`div`d=t:z(10*(a-c*t))(10*(b-d*t))c d w|True=z(x*a+b)a(x*c+d)c y where{t=a`div`c};f n=1:1:n:f(n+2)in z 1 0 0 1(2:1:2:f 4)>>=show | |
> let f n=1:1:n:f(n+2);z a b c d w@(x:y)|t<-a`div`c,all(>0)[a,b,c,d]&&t==b`div`d=t:z(10*(a-c*t))(10*(b-d*t))c d w|True=z(x*a+b)a(x*c+d)c y in z 1 0 0 1(2:1:2:f 4)>>=show | |
> let f n=1:1:n:f(n+2);z a b c d w@(x:y)|any(<=0)[a,b,c,d]||t/=b`div`d=z(x*a+b)a(x*c+d)c y|t<-a`div`c=t:z(10*(a-c*t))(10*(b-d*t))c d w |
This file contains hidden or 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
#include <tr1/type_traits> | |
#include <iostream> | |
#include <vector> | |
#include <algorithm> | |
// (* -> *) -> Constraint | |
template<template <typename> class T> | |
class Functor { | |
public: | |
template <typename A, typename B> |
This file contains hidden or 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 Blink (main) where | |
import Language.Atom | |
name :: Name | |
name = "blink" | |
timeout :: Int | |
timeout = 40000 |
This file contains hidden or 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
// Questions about \/ and Validation | |
object scalaz { | |
/* | |
This explanation might help. This is a compilable source file with revisions | |
available at https://gist.github.com/tonymorris/8263051 | |
Fact: All monads are applicative functors. As has been seen we can witness the | |
`Applicative` that arises from the `Monad` primitives. Let's illustrate this: |
OlderNewer