this repo has no description
0
fork

Configure Feed

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

init

Tony Morris 825eb489

+245
+12
.ghci
··· 1 + :set -isrc 2 + :l src/Lets.hs 3 + :set prompt ">> " 4 + :set -Wall 5 + :set -fno-warn-unused-binds 6 + :set -fno-warn-unused-do-bind 7 + :set -fno-warn-unused-imports 8 + :set -fno-warn-type-defaults 9 + :set -XNoImplicitPrelude 10 + :set -XScopedTypeVariables 11 + :set -XOverloadedStrings 12 + :set -XRebindableSyntax
+30
.gitignore
··· 1 + *~ 2 + *#* 3 + 4 + # CABAL 5 + /dist 6 + /cabal-dev 7 + /.cabal-sandbox 8 + /cabal.sandbox.config 9 + 10 + # Haskell Program Coverage 11 + /.hpc 12 + 13 + # Leksah 14 + *.lkshs 15 + 16 + # Intellij IDEA 17 + /.idea 18 + 19 + # darcs 20 + /_darcs 21 + 22 + # ctags 23 + TAGS 24 + 25 + # sbt 26 + /project 27 + /target 28 + 29 + *.swp 30 +
+27
LICENCE
··· 1 + Copyright 2012-2015 National ICT Australia Limited 2 + 3 + All rights reserved. 4 + 5 + Redistribution and use in source and binary forms, with or without 6 + modification, are permitted provided that the following conditions 7 + are met: 8 + 1. Redistributions of source code must retain the above copyright 9 + notice, this list of conditions and the following disclaimer. 10 + 2. Redistributions in binary form must reproduce the above copyright 11 + notice, this list of conditions and the following disclaimer in the 12 + documentation and/or other materials provided with the distribution. 13 + 3. Neither the name of the author nor the names of his contributors 14 + may be used to endorse or promote products derived from this software 15 + without specific prior written permission. 16 + 17 + THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 18 + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE 21 + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 + OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 + OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 + SUCH DAMAGE.
+1
README.markdown
··· 1 + # Let's Lens
+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}
+4
changelog
··· 1 + 0.0.1 2 + 3 + Init 4 +
+71
lets-lens.cabal
··· 1 + name: lets-lens 2 + version: 0.0.1 3 + license: BSD3 4 + license-file: LICENCE 5 + author: Tony Morris <ʇǝu˙sıɹɹoɯʇ@ןןǝʞsɐɥ> 6 + maintainer: Tony Morris <ʇǝu˙sıɹɹoɯʇ@ןןǝʞsɐɥ> 7 + copyright: Copyright (C) 2015 National ICT Australia Limited 8 + synopsis: Source code for exercises on the lens concept 9 + category: Education 10 + description: Source code for exercises on the lens concept 11 + homepage: https://github.com/tonymorris/lets-lens 12 + bug-reports: https://github.com/tonymorris/lets-lens/issues 13 + cabal-version: >= 1.10 14 + build-type: Custom 15 + extra-source-files: changelog 16 + 17 + source-repository head 18 + type: git 19 + location: git@github.com:tonymorris/lets-lens.git 20 + 21 + flag small_base 22 + description: Choose the new, split-up base package. 23 + 24 + library 25 + default-language: Haskell2010 26 + 27 + build-depends: base < 5 && >= 4 28 + , QuickCheck >= 2.0 29 + , doctest >= 0.9.7 30 + , containers >= 0.4.0.0 31 + , array >= 0.4 32 + 33 + ghc-options: -Wall 34 + -fno-warn-unused-binds 35 + -fno-warn-unused-do-bind 36 + -fno-warn-unused-imports 37 + -fno-warn-type-defaults 38 + 39 + default-extensions: NoImplicitPrelude 40 + ScopedTypeVariables 41 + InstanceSigs 42 + RebindableSyntax 43 + 44 + hs-source-dirs: src 45 + 46 + exposed-modules: Lets 47 + 48 + test-suite doctests 49 + type: 50 + exitcode-stdio-1.0 51 + 52 + main-is: 53 + doctests.hs 54 + 55 + default-language: 56 + Haskell2010 57 + 58 + build-depends: 59 + base < 5 && >= 3 60 + , doctest >= 0.9.7 61 + , filepath >= 1.3 62 + , directory >= 1.1 63 + , QuickCheck >= 2.0 64 + , template-haskell >= 2.8 65 + 66 + ghc-options: 67 + -Wall 68 + -threaded 69 + 70 + hs-source-dirs: 71 + test
+2
src/Lets.hs
··· 1 + module Lets where 2 +
+8
test/.gitignore
··· 1 + # cabal 2 + /dist 3 + 4 + # cabal-dev 5 + /cabal-dev 6 + 7 + # Haskell Program Coverage 8 + /.hpc
+46
test/doctests.hs
··· 1 + module Main where 2 + 3 + import Build_doctests (deps) 4 + import Control.Applicative 5 + import Control.Monad 6 + import Data.List 7 + import System.Directory 8 + import System.FilePath 9 + import Test.DocTest 10 + 11 + main :: 12 + IO () 13 + main = 14 + getSources >>= \sources -> doctest $ 15 + "-isrc" 16 + : "-idist/build/autogen" 17 + : "-optP-include" 18 + : "-optPdist/build/autogen/cabal_macros.h" 19 + : "-hide-all-packages" 20 + : map ("-package="++) deps ++ sources 21 + 22 + sourceDirectories :: 23 + [FilePath] 24 + sourceDirectories = 25 + [ 26 + "src" 27 + ] 28 + 29 + isSourceFile :: 30 + FilePath 31 + -> Bool 32 + isSourceFile p = 33 + and [takeFileName p /= "Setup.hs", isSuffixOf ".hs" p] 34 + 35 + getSources :: IO [FilePath] 36 + getSources = 37 + liftM (filter isSourceFile . concat) (mapM go sourceDirectories) 38 + where 39 + go dir = do 40 + (dirs, files) <- getFilesAndDirectories dir 41 + (files ++) . concat <$> mapM go dirs 42 + 43 + getFilesAndDirectories :: FilePath -> IO ([FilePath], [FilePath]) 44 + getFilesAndDirectories dir = do 45 + c <- map (dir </>) . filter (`notElem` ["..", "."]) <$> getDirectoryContents dir 46 + (,) <$> filterM doesDirectoryExist c <*> filterM doesFileExist c