first commit

This commit is contained in:
michaelt 2014-04-26 23:21:13 -04:00
parent 9158d5c12a
commit 505764afb5
5 changed files with 70 additions and 20 deletions

41
LICENSE
View File

@ -1,27 +1,30 @@
Copyright (c) 2014, Michael Thompson
Copyright (c) 2014, michaelt
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of the {organization} nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
* Neither the name of michaelt nor the names of other
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

21
Lens/Simple.hs Normal file
View File

@ -0,0 +1,21 @@
module Lens.Simple (
module Lens.Family2,
module Lens.Family2.Unchecked,
module Lens.Family2.Stock,
module Lens.Family2.State.Strict
) where
import Lens.Family2
import Lens.Family2.Unchecked
import Lens.Family2.Stock
import Lens.Family2.State.Strict
infixl 1 ??
-- | Generalized infix flip, replicating Control.Lens.Lens.??
-- >>> execStateT ?? (0,"") $ do _1 += 1; _1 += 1; _2 <>= "hello"
-- (2,"hello")
(??) :: Functor f => f (a -> b) -> a -> f b
ff ?? a = fmap ($ a) ff
{-# INLINE (??) #-}

View File

@ -1,4 +1,6 @@
lens-simple
===========
lens-family re-exports, with "Lens.Family2.State.Strict"
This just re-exports the combinators and elementary 'van Laarhoven' lenses from Russell O'Connor's sublime [`lens-family`](http://hackage.haskell.org/package/lens-family) package, including "Lens.Family2.State.Strict". The naming in `lens-family` is now more or less uniform with the more powerful and elaborate [`lens`](http://hackage.haskell.org/package/lens) library.
This package is merely intended to simplify imports -- just write `import Lens.Simple` -- for use with [`pipes`](http://hackage.haskell.org/package/pipes) and associated libraries, which frequently require that some version of `view/(^.)` and `zoom` should be in scope. Presumably much more should be hidden!

2
Setup.hs Normal file
View File

@ -0,0 +1,2 @@
import Distribution.Simple
main = defaultMain

22
lens-simple.cabal Normal file
View File

@ -0,0 +1,22 @@
name: lens-simple
version: 0.1.0.0
synopsis: Re-exports sensible modules from Russell O'Connor's lens-family package.
-- description:
homepage: https://github.com/michaelt/lens-simple
license: BSD3
license-file: LICENSE
author: michaelt
maintainer: what_is_it_to_do_anything@yahoo.com
-- copyright:
-- category:
build-type: Simple
extra-source-files: README.md
cabal-version: >=1.10
library
exposed-modules: Lens.Simple
-- other-modules:
-- other-extensions:
build-depends: base, lens-family >=1.0
-- hs-source-dirs:
default-language: Haskell2010