this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

nix

+59 -109
+2
Setup.hs
··· 1 + import Distribution.Simple 2 + main = defaultMain
-44
Setup.lhs
··· 1 - #!/usr/bin/env runhaskell 2 - \begin{code} 3 - {-# OPTIONS_GHC -Wall #-} 4 - module Main (main) where 5 - 6 - import Data.List ( nub ) 7 - import Data.Version ( showVersion ) 8 - import Distribution.Package ( PackageName(PackageName), PackageId, InstalledPackageId, packageVersion, packageName ) 9 - import Distribution.PackageDescription ( PackageDescription(), TestSuite(..) ) 10 - import Distribution.Simple ( defaultMainWithHooks, UserHooks(..), simpleUserHooks ) 11 - import Distribution.Simple.Utils ( rewriteFile, createDirectoryIfMissingVerbose ) 12 - import Distribution.Simple.BuildPaths ( autogenModulesDir ) 13 - import Distribution.Simple.Setup ( BuildFlags(buildVerbosity), fromFlag ) 14 - import Distribution.Simple.LocalBuildInfo ( withLibLBI, withTestLBI, LocalBuildInfo(), ComponentLocalBuildInfo(componentPackageDeps) ) 15 - import Distribution.Verbosity ( Verbosity ) 16 - import System.FilePath ( (</>) ) 17 - 18 - main :: IO () 19 - main = defaultMainWithHooks simpleUserHooks 20 - { buildHook = \pkg lbi hooks flags -> do 21 - generateBuildModule (fromFlag (buildVerbosity flags)) pkg lbi 22 - buildHook simpleUserHooks pkg lbi hooks flags 23 - } 24 - 25 - generateBuildModule :: Verbosity -> PackageDescription -> LocalBuildInfo -> IO () 26 - generateBuildModule verbosity pkg lbi = do 27 - let dir = autogenModulesDir lbi 28 - createDirectoryIfMissingVerbose verbosity True dir 29 - withLibLBI pkg lbi $ \_ libcfg -> do 30 - withTestLBI pkg lbi $ \suite suitecfg -> do 31 - rewriteFile (dir </> "Build_" ++ testName suite ++ ".hs") $ unlines 32 - [ "module Build_" ++ testName suite ++ " where" 33 - , "deps :: [String]" 34 - , "deps = " ++ (show $ formatdeps (testDeps libcfg suitecfg)) 35 - ] 36 - where 37 - formatdeps = map (formatone . snd) 38 - formatone p = case packageName p of 39 - PackageName n -> n ++ "-" ++ showVersion (packageVersion p) 40 - 41 - testDeps :: ComponentLocalBuildInfo -> ComponentLocalBuildInfo -> [(InstalledPackageId, PackageId)] 42 - testDeps xs ys = nub $ componentPackageDeps xs ++ componentPackageDeps ys 43 - 44 - \end{code}
+26
default.nix
··· 1 + { nixpkgs ? import <nixpkgs> {}, compiler ? "default" }: 2 + let 3 + inherit (nixpkgs) pkgs; 4 + haskellPackages = if compiler == "default" 5 + then pkgs.haskellPackages 6 + else pkgs.haskell.packages.${compiler}; 7 + 8 + tasty-hedgehog-github = pkgs.callPackage (pkgs.fetchFromGitHub { 9 + owner = "qfpl"; 10 + repo = "tasty-hedgehog"; 11 + rev = "5da389f5534943b430300a213c5ffb5d0e13459e"; 12 + sha256 = "04pmr9q70gakd327sywpxr7qp8jnl3b0y2sqxxxcj6zj2q45q38m"; 13 + }) {}; 14 + 15 + modifiedHaskellPackages = haskellPackages.override { 16 + overrides = self: super: { 17 + tasty-hedgehog = 18 + if super ? tasty-hedgehog 19 + then super.tasty-hedgehog 20 + else tasty-hedgehog-github; 21 + }; 22 + }; 23 + 24 + lets-lens = modifiedHaskellPackages.callPackage ./lets-lens.nix {}; 25 + in 26 + lets-lens
+5 -7
lets-lens.cabal
··· 4 4 license-file: LICENCE 5 5 author: Tony Morris <ʇǝu˙sıɹɹoɯʇ@ןןǝʞsɐɥ> 6 6 maintainer: Tony Morris <ʇǝu˙sıɹɹoɯʇ@ןןǝʞsɐɥ> 7 - copyright: Copyright (C) 2015 National ICT Australia Limited 7 + copyright: Copyright (C) 2015-2016 National ICT Australia Limited 8 + copyright: Copyright (c) 2018, Commonwealth Scientific and Industrial Research Organisation (CSIRO) ABN 41 687 119 230. 8 9 synopsis: Source code for exercises on the lens concept 9 10 category: Education 10 11 description: Source code for exercises on the lens concept 11 12 homepage: https://github.com/data61/lets-lens 12 13 bug-reports: https://github.com/data61/lets-lens/issues 13 14 cabal-version: >= 1.10 14 - build-type: Custom 15 + build-type: Simple 15 16 extra-source-files: changelog 16 17 17 18 source-repository head ··· 24 25 library 25 26 default-language: Haskell2010 26 27 27 - build-depends: base < 5 && >= 4 28 - , QuickCheck >= 2.0 29 - , doctest >= 0.9.7 28 + build-depends: base >= 4.8 && < 5 30 29 , containers >= 0.4.0.0 31 - , array >= 0.4 32 - 30 + 33 31 ghc-options: -Wall 34 32 -fno-warn-unused-binds 35 33 -fno-warn-unused-do-bind
+15
lets-lens.nix
··· 1 + { mkDerivation, base, containers, directory, doctest, filepath 2 + , QuickCheck, stdenv, template-haskell 3 + }: 4 + mkDerivation { 5 + pname = "lets-lens"; 6 + version = "0.0.1"; 7 + src = ./.; 8 + libraryHaskellDepends = [ base containers ]; 9 + testHaskellDepends = [ 10 + base directory doctest filepath QuickCheck template-haskell 11 + ]; 12 + homepage = "https://github.com/data61/lets-lens"; 13 + description = "Source code for exercises on the lens concept"; 14 + license = stdenv.lib.licenses.bsd3; 15 + }
+7
shell.nix
··· 1 + { nixpkgs ? import <nixpkgs> {}, compiler ? "default" }: 2 + let 3 + inherit (nixpkgs) pkgs; 4 + drv = import ./default.nix { inherit nixpkgs compiler; }; 5 + drvWithTools = pkgs.haskell.lib.addBuildDepends drv [ pkgs.cabal-install ]; 6 + in 7 + if pkgs.lib.inNixShell then drvWithTools.env else drvWithTools
-8
test/.gitignore
··· 1 - # cabal 2 - /dist 3 - 4 - # cabal-dev 5 - /cabal-dev 6 - 7 - # Haskell Program Coverage 8 - /.hpc
+4
test/Tests.hs
··· 1 + module Main where 2 + 3 + main :: IO () 4 + main = pure ()
-50
test/doctests.hs
··· 1 - {-# LANGUAGE CPP #-} 2 - 3 - module Main where 4 - 5 - import Build_doctests (deps) 6 - #if (__GLASGOW_HASKELL__ < 710) 7 - import Control.Applicative 8 - #endif 9 - import Control.Monad 10 - import Data.List 11 - import System.Directory 12 - import System.FilePath 13 - import Test.DocTest 14 - 15 - main :: 16 - IO () 17 - main = 18 - getSources >>= \sources -> doctest $ 19 - "-isrc" 20 - : "-idist/build/autogen" 21 - : "-optP-include" 22 - : "-optPdist/build/autogen/cabal_macros.h" 23 - : "-hide-all-packages" 24 - : map ("-package="++) deps ++ sources 25 - 26 - sourceDirectories :: 27 - [FilePath] 28 - sourceDirectories = 29 - [ 30 - "src" 31 - ] 32 - 33 - isSourceFile :: 34 - FilePath 35 - -> Bool 36 - isSourceFile p = 37 - and [takeFileName p /= "Setup.hs", isSuffixOf ".hs" p] 38 - 39 - getSources :: IO [FilePath] 40 - getSources = 41 - liftM (filter isSourceFile . concat) (mapM go sourceDirectories) 42 - where 43 - go dir = do 44 - (dirs, files) <- getFilesAndDirectories dir 45 - (files ++) . concat <$> mapM go dirs 46 - 47 - getFilesAndDirectories :: FilePath -> IO ([FilePath], [FilePath]) 48 - getFilesAndDirectories dir = do 49 - c <- map (dir </>) . filter (`notElem` ["..", "."]) <$> getDirectoryContents dir 50 - (,) <$> filterM doesDirectoryExist c <*> filterM doesFileExist c