Say more by saying less. Learn how parametric types, when used in conjunction with an adequately strong type system, help the programmer comprehend code by invalidating candidate programs. Parametricity helps the programmer by enabling deduction of theories about what a program cannot do, sometimes to the point of leaving no ambiguity.
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 Every where | |
import Control.Lens | |
import Control.Monad.Fix | |
-- | | |
-- | |
-- >>> everyN 2 [] | |
-- [] | |
-- |
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 System.Environment | |
import System.IO | |
import Control.Monad (when) | |
matchGlob :: String -> String -> Bool | |
matchGlob = undefined | |
main :: IO () | |
main = do | |
args <- getArgs |
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
Response to https://peerj.com/preprints/826v1/ | |
1. | |
The method is dubious with respect to the conclusion. | |
The researchers do not analyse the code using any formal | |
or even established reliable methods. Instead, the metric that is used is "look | |
to see if some *detected* bug, which was fixed *post-release*. |
mount indicators- install air filter
install rear rackinstall braided fuel line- install headlight protector
mount spotlightsinstall windscreen- change oil filters
- install foam air filter
- adjust rear shock
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
// see https://github.com/gseitz/Lensed | |
case class CoState[A, B](put: A => B, pos: A) | |
object CoState { | |
type Store[A, B] = CoState[A, B] | |
} | |
// fused get/set | |
case class Lens[A, B](lens: A => CoState[B, 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
name: package | |
version: 0.0.1 | |
license: BSD3 | |
license-File: LICENCE | |
category: Development | |
cabal-version: >= 1.10 | |
build-type: Custom | |
flag small_base | |
description: Choose the new, split-up base package. |
There seems to be a lot of confusion around Effects and IO. I wanted to collect a set of questions and answers, and explanations of common misconceptions.
- What is an Effect?
Effects come in many different shapes. In terms of monadic effects, there are different shapes again. For example, List (non-determinism), State, IO, Cont.
- What is a Side Effect?
An effect that is occurs to the side of the effect you are otherwise running within. In most standard environments, this is an IO effect that occurs outside of the otherwise effectful environment.
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 Control.Applicative | |
import Control.Concurrent (forkIO, newEmptyMVar, putMVar, takeMVar) | |
import Control.Monad | |
import Control.Monad.Trans.Class | |
import Control.Monad.IO.Class | |
import System.Command | |
newtype Cmd m a = Cmd { runCmd :: m (Either (Int, String) a) } | |
cmd :: MonadIO m => FilePath -> [String] -> String -> Cmd m String |
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
#include <tr1/type_traits> | |
#include <iostream> | |
#include <vector> | |
#include <algorithm> | |
// (* -> *) -> Constraint | |
template<template <typename> class T> | |
class Functor { | |
public: | |
template <typename A, typename B> |
OlderNewer