Structurally typed arguments and zero extra rubbish
-- Stargazer's, very small, API
-- An option can take a single string argument or nothing at all.
string :: Schema String
nothing :: Schema ()
-- | Traverse the structure using the traversal but memoize the | |
-- results of the transforming function; this means that the function | |
-- is called once for every unique element. | |
-- | |
-- NB: I can't work out how to do this with only one optic argument, | |
-- but it should be possible. | |
-- | |
-- prop> traverseNubOf (traverse._1) (traverse._1) (\x -> do print x; return (-x)) [(2,10),(2,20),(1,30),(1,40),(3,50),(3,60)] | |
-- 1 | |
-- 2 |
{-# LANGUAGE RecordWildCards, PatternGuards, ViewPatterns #-} | |
module Cabal(run, readCabal, extractCabal) where | |
import Control.Monad.Extra | |
import Control.Exception.Extra | |
import Data.Char | |
import Data.List.Extra | |
import Data.Maybe | |
import Data.Functor |
{-# LANGUAGE TypeOperators #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
{-# LANGUAGE AllowAmbiguousTypes #-} | |
module Test2 where | |
data Proxy a = Proxy |
> {-# LANGUAGE Rank2Types #-} | |
> | |
> import Prelude hiding (id) | |
> import Data.Functor.Constant (Constant(Constant), getConstant) | |
> import Control.Arrow (Arrow, arr, first, Kleisli(Kleisli), runKleisli, (&&&)) | |
> import Control.Category ((<<<)) | |
> import Control.Lens (sequenceAOf) | |
> import qualified Control.Lens as L | |
> import qualified Control.Lens.Internal.Setter as LS | |
> import Data.Profunctor (Profunctor, rmap) |
An Introduction to General Systems Thinking by Gerald M. Weinberg. https://idiscover.lib.cam.ac.uk/permalink/f/t9gok8/44CAM_ALMA21337181530003606 SF4 340:7.c
General Principles of Systems Design by Gerald M. Weinberg and Daniela Weinberg. https://idiscover.lib.cam.ac.uk/permalink/f/t9gok8/44CAM_ALMA21497195560003606 SF4
Peter Senge's Fifth Discipline
-- Requires branch https://github.com/tomjaguarpaw/haskell-opaleye/tree/dynamic-fields | |
-- | |
-- If you use this please contact me http://web.jaguarpaw.co.uk/~tom/contact/ and let me | |
-- know what you think. | |
import Data.String | |
import Opaleye | |
import Opaleye.Internal.Dynamic (SqlDynamic, Dynamic, | |
stringFromFields, stringUnpackspec) |
{-# LANGUAGE ScopedTypeVariables #-} | |
{-# LANGUAGE DeriveGeneric #-} | |
{-# OPTIONS_GHC -Wall #-} | |
module StrangeHashable where | |
import Data.Hashable | |
import GHC.Generics (Generic) | |
data ListF a r = ConsF a r | NilF deriving Generic |
{-# LANGUAGE TemplateHaskell #-} | |
{-# OPTIONS_GHC -Wall #-} | |
module Main where | |
import Control.Lens (makeLenses, use, (%=), (.=)) | |
import Control.Monad (when) | |
import Control.Monad.Trans.State.Strict (evalState) | |
import Data.Traversable (for) |
{-# LANGUAGE DeriveFunctor #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE TemplateHaskell #-} | |
{-# LANGUAGE TypeOperators #-} | |
{-# LANGUAGE UndecidableInstances #-} | |
import Control.Applicative | |
import Data.Profunctor |